Hi,
I am trying to implement the php include function on my website. One problem that I am coming across, is that for the different pages, the section that the person is on will be a different colour (e.g. if someone clicks on the 'Gallery' page, then that button will be grey and the rest will be Orange. I have got a page called 'pages.php'. This is the page where all of my navigation links are stored. Currently this is a bit of the coding:
<li><a href="gallery.php" class=" active"><span><span>Gallery</span></span></a></li>
It is the class="active" bit that makes the button grey. How can I amend the php so that it changes depending on which page the person is on? e.g. if someone clicks on the 'About Us' page, how would I tell it to not use it for the gallery.php and to use it for the aboutus.php?
Thanks.
php include - navigation
Moderator: General Moderators
Re: php include - navigation
You can read the filename of the current page in $_SERVER['SCRIPT_NAME']; basename() may be of interest.
Re: php include - navigation
Hi,
Is that something I am meant to be looking for? or is that a script that I need to use. Sorry, but haven't done this before.
Thanks,
Is that something I am meant to be looking for? or is that a script that I need to use. Sorry, but haven't done this before.
Thanks,