Forums: Front End:

 

PHP Active URL Navigation Question

first
 

BOBBYLOVEVILLE PHP Active URL Navigation Question

building a site where the three site components are includes into every page (header.php, whateverpagecontent.php, and footer.php). header.php contains the sites navigation and has the simple javascript rollover image functionality that dreamweaver populates, so that every page section has a "over" image and a regular image (home.jpg -> homeOVER.jpg, about.jpg - > aboutOVER.jpg,...)

What I am looking to be able to do is to have the header.php, when called into the requested url, look to the url and then show the "over" image as the active state of the page that I have defined. So if you click on "about" link it would take you to website.com/about.php and about.php would have an include for the header.php and when that loads it looks to the URL and would show the aboutOVER.jpg image on that page....

Make sense? Can anyone offer up anything, or point me to the solution?

Gracias peeps!

 

ShEx

You could use:


$pathInfo = pathinfo(__FILE__);

var_dump($pathInfo);



That should give you the filename and depending on your php version it might have the filename without the extension - if not then you'll just have to do a bit of a substring on it.

 
first
 

Forums: Front End: PHP Active URL Navigation Question

 
New Post
 
You must be logged in to post