Determining the name of the current page

This is a trival problem however I am having difficulty locating the proper function to satisfy it. I am attempting to have PHP select the proper navigation bar for each page of my website. I can’t figure out how to determine the file name of the page that is currently being processed! For example a users would click the link
“/home/contact.php”

the Home navigation bar would appear. I can get the code to work through $HTTP_REFERRER. However, it will not work when the users is externally linking to my site. Thus, I need to obtain the information from the server each time.

Thank you for you help,
Bob

Well the page currently being processed would NOT be the HTTP_REFERER. It would be $_SERVER[‘PHP_SELF’] ( The $_SERVER is the newer style of using the SUPER GLOBALS)

Sponsor our Newsletter | Privacy Policy | Terms of Service