How to include page-specific navbar?

steelphantom

macrumors 6502a
Original poster
Oct 15, 2005
555
1
Some of you guys might have already seen the site I've been working on lately, http://www.theleafsband.com/. Thanks for your feedback and assistance!

The site is (at least for now) functionally complete. However, I'd like to make a little behind-the-scenes change to make any future design changes easier. As you probably noticed, the green navigation bar on site highlights which section of the site you're visiting. I'd like to include the navbar in my header.php file, but have it still highlight the current section of the site (e.g. if you're on the band.php page, the "Band" section of the navbar will be highlighted).

I'm thinking the best way to do this is to somehow check the current URL with PHP and then make a decision on which link gets the highlight. Unfortunately, I'm not exactly sure how to implement this. I'd imagine it's not too difficult. Any suggestions or ideas? Thanks! :)
 

steelphantom

macrumors 6502a
Original poster
Oct 15, 2005
555
1
Ah, I figured it out. $_SERVER['REQUEST_URI'] was what I was looking for. Thanks!
 

LeeTom

macrumors 68000
May 31, 2004
1,538
95
also just search for PHP GET URL.. there are some cleaner options out there than what i posted i think...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.