Question for all you guys:

I'm building a site and having the menu be dynamically generated with PHP. I don't want the current page's name on the menu to be a link, so I wrote a script that checks to see if the current page (found by using basname($PHP_SELF)) is equal to the link that is being put in. If it is, don't make it a link, but if it isn't, create the link.

The problem is that I'm making my pages pretty dynamic, so I'm reusing the same page a few times and changing it depending on a GET variable sent through the menu.

When it generates the menu, two of the links have the same basename($PHP_SELF) because that function just spits out 'something.php' and not 'something.php?type=gallery' meaning that all pages that are based on 'something.php' are coming out the same and the menu responds by making those items not clickable.

Is there any $_SERVER variable that I could use that will spit out 'something.php?type=gallery' instead of 'something.php' ? Thanks for any help... sorry for the long winded explanation.

    $SERVER['PHP_SELF'] == name of page
    $
    SERVER['QUERY_STRING'] == stuff after name of page
    $_SERVER['REQUEST_URI'] == all of the above

    HTH,

      Or improve your handling of $_GET['location'].

        Originally posted by dalecosp
        $SERVER['PHP_SELF'] == name of page
        $
        SERVER['QUERY_STRING'] == stuff after name of page
        $_SERVER['REQUEST_URI'] == all of the above

        HTH,

        It worked like a charm! Thank you so much!

          Write a Reply...