Search Results

Search found 2 results on 1 pages for 'arsoneffect'.

Page 1/1 | 1 

  • PHP if statement - select two different get variables?

    - by arsoneffect
    Below is my example script: <li><a <?php if ($_GET['page']=='photos' && $_GET['view']!=="projects"||!=="forsale") { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos\""); } ?>>Photos</a></li> <li><a <?php if ($_GET['view']=='projects') { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos&view=projects\""); } ?>>Projects</a></li> <li><a <?php if ($_GET['view']=='forsale') { echo ("href=\"#\" class=\"active\""); } else { echo ("href=\"/?page=photos&view=forsale\""); } ?>>For Sale</a></li> I want the PHP to echo the "href="#" class="active" only when it is not on the two pages: ?page=photos&view=forsale or ?page=photos&view=projects

    Read the article

  • If-statement: how to pull 2nd GET variable

    - by arsoneffect
    How do I get this to pull my 2nd variable? (I already have a switch setup) <body id="<?php if (! isset($_GET['page'])) { echo "home"; } else { $_GET['page']; echo $page; } ?>"> I have a switch statement that pulls the pages from index.php?page=##### and I have just added this part to my switch: index.php?page=####&section=##### Right now, if I am on page=photos, my code ends up being: <body id="photos"> I need to make it so that if any link has the "sections" variable on it like this page=photos&section=cars it uses the same ID: <body id="photos">

    Read the article

1