Dynamically change anchor id based on current page.
Posted: Sat Sep 13, 2008 10:28 am
I have a pretty basic website started. However, since I know I will have to add/change/delete certain parts of the menu, I decided to make the menu an included PHP file.
However, I also have set up a "current" id for the anchor tag. Normally it would be easy, and I would just add "<a href="somepage.php" id="current">". However, since it is an included page, I was wondering if I could set it up to, depending on which page you are at, add the id="current" dynamically, using PHP of course.
Would I do this on the menu.php file or somewhere on the page where I call the 'include' function?
Thanks. Any help is appreciated,
Antoine
However, I also have set up a "current" id for the anchor tag. Normally it would be easy, and I would just add "<a href="somepage.php" id="current">". However, since it is an included page, I was wondering if I could set it up to, depending on which page you are at, add the id="current" dynamically, using PHP of course.
Would I do this on the menu.php file or somewhere on the page where I call the 'include' function?
Thanks. Any help is appreciated,
Antoine