Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9006273
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:21:58+00:00 2026-06-16T01:21:58+00:00

What I am trying to do is echo out based on the $_GET[‘page’] variable

  • 0

What I am trying to do is echo out based on the $_GET[‘page’] variable however its echoing this out for all of my navigation menu’s. How can I only have it use the page I am on? This is only the php part of it, the actual html code goes below each line however for simplicity I did not include it

<?php if($_GET['page'] == 'user_edit' || 'NULL'){ echo "<li class=\"current\">"; } else{ echo "<li>";} ?>
<?php if($_GET['page'] == 'manage' || 'add' || 'ftp'){ echo "<li class=\"current\">"; } else{ echo "<li>";} ?>
<?php if($_GET['page'] == 'bugs' || 'support' || 'notifications'){ echo "<li class=\"current\">"; } else{ echo "<li>";} ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T01:21:59+00:00Added an answer on June 16, 2026 at 1:21 am

    It does not work like this. Your conditions are evaluated as:

    if ( ( $var == 'foo' ) || ( 'bar' ) || ( 'baz' ) )
    

    Note the grouping above. All three are separate expressions. It does not mean “if $var equals ‘foo’, ‘bar’ or ‘baz'”, it means “if $var equals ‘foo’ is true or ‘bar’ is true or ‘baz’ is true”.

    And 'bar' is always true.

    You need:

    if ($var == 'foo' || $var == 'bar' || $var == 'baz')
    

    or

    if (in_array($var, array('foo', 'bar', 'baz'))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a navigation, where I echo out the class based on the variable
I trying to figure out how to output my php to echo for my
I'm trying to echo the XML content at this URL but I'm having difficulty.
I'm trying to echo a value in a form based on number of rows
i am trying to echo out an submit button input tag of the type
I've been trying to figure this out, but it seems to be harder than
I'm trying to get the first 10 posts based on page views through Wordpress
I'm trying to find out why this entire code below is producing only ONE
I'm trying echo the contents of an object in a JSON format. I'm quite
im trying to echo mediaplayer embed code with IF statement. is there any way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.