How to make a navigation bar in a single PHP page with mouseovers and images of the current page?

advertisements

I've been making pages with navigation with three states: normal, hover, and current page. Normally I just use a simple mouseover script, and I include the navigation code on every page so that I can make the link for the current page inactive, and a different, third image. This is a sloppy way of doing it.

What's the best way to do this so I can write it all in a single header page and call that for every page, yet still retain the ability to deactivate the link for the current page, and switching the image?


put it in a seperate header file, then in PHP, call include("header.php"); or whatever the name of your file is. you can then use $_SERVER["REQUEST_URI"] to get the current page, and change behavior with that.