Jump to content

PHP Include menu


svdb
 Share

Recommended Posts

I'm building an website and I would like to include my menu, that is on all the pages, by using PHP. I've only one problem. When you're are on a page the menu item that linkes to that specific page has an different color.I now did this by giving the menu item a class="active". Can I include my menu with php and still be able to have these highlighted menuitems?thank you

Link to comment
Share on other sites

  • 2 weeks later...

MEGA BUMP!!!jkloth, when you say "use a POST or GET variable" I'm assuming that's something along the lines of having a code which gets the name of the page?Is it something relatively simple where somewhere in the page, you have a php code block which declares the name of the page, and then in the nav include file, you have another php code block that says get the names of these pages, and format the current page according to the stylesheet linked in the page?Thanks.EDIT: Scratch that, sorry for the bump. I've found a pure CSS solution. I'd be welcome to share if asked. It's quite ingenious actually...

Edited by Coaxsist
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...