I'm creating a left hand nav menu. I want to find out how to use the current filename to indicate to my script that the specified link is the current page (so i can then have it a different colour and not clickable).
Such as if you are on november04.php then it might be grey and not a clickable link anymore.
The code I have so far to display the menu is:
$fullPath = $_SERVER['PHP_SELF'];
$tmpArray = split("/", $fullPath);
$count = count($tmpArray);
$filename = $tmpArray[$count - 1];
// This programs the left navbar to display correctly with current page not selectable
$menu = array (array ('index', '+ Home'),
array ('november04', '+ Nov 2004'),
array ('october04', '+ Oct 2004'),
array ('september04', '+ Sep 2004'),
array ('august04', '+ Aug 2004'),
array ('july04', '+ Jul 2004'),
array ('june04', '+ Jun 2004'),
array ('may04', '+ May 2004'));
$menulength = count($menu);
for ($i = 0; $i < $menulength; $i++)
{
$menuitem1 = $menu[$i][0];
$menuitem2 = $menu[$i][1];
echo "<ul>";
echo "<li><a href=\"$menuitem1.php\">$menuitem2</a></li>";
echo "</ul>";
}
Any ideas would be much appreciated as I'm just a little bit stumped for the time being.... and thanks in advance...
Norty Pig Web Development
http://www.nortypig.com
http://www.blog.nortypig.com