How to include page-specific navbar?

Discussion in 'Web Design and Development' started by steelphantom, Dec 6, 2009.

  1. steelphantom macrumors 6502a

    steelphantom

    Joined:
    Oct 15, 2005
    #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! :)
     
  2. steelphantom thread starter macrumors 6502a

    steelphantom

    Joined:
    Oct 15, 2005
    #3
  3. steelphantom thread starter macrumors 6502a

    steelphantom

    Joined:
    Oct 15, 2005
    #4
    Ah, I figured it out. $_SERVER['REQUEST_URI'] was what I was looking for. Thanks!
     
  4. LeeTom macrumors 68000

    LeeTom

    Joined:
    May 31, 2004
    #5
  5. LeeTom macrumors 68000

    LeeTom

    Joined:
    May 31, 2004
    #6
    also just search for PHP GET URL.. there are some cleaner options out there than what i posted i think...
     
  6. steelphantom thread starter macrumors 6502a

    steelphantom

    Joined:
    Oct 15, 2005
    #7
    Got it all figured out. That wasn't too bad at all! Thanks, LeeTom! :)
     
  7. LeeTom macrumors 68000

    LeeTom

    Joined:
    May 31, 2004

Share This Page