Page 1 of 1

CSS Menu highlighting current page

Posted: Sat Jun 20, 2009 3:39 am
by vidal
I'm writing a small static site and I've got a navigation menu as an unordered list with CSS styling. I am styling the menu to highlight the current page using a different class to the rest of the menu. I usually use <?php include('navigation.html'); ?> an external navigation file so that changes to the site structure can be added globally. Is there an easy way to use php to read the current page and style the list appropriately?

James

Re: CSS Menu highlighting current page

Posted: Sat Jun 20, 2009 5:40 am
by terier

Code: Select all

$page = basename($_SERVER['PHP_SELF']);