First, declare a variable in the very first line of your pages:
<?php $thisPage='home'; ?> change home to name of the page
PHP Code:
<?php
echo "<ul class=\"glossymenu\">";
if ($thisPage=='home') {
echo '<li class="current"><a href="home.htm"><b>Home</b></a></li>';}
else {
echo '<li><a href="home.htm"><b>Home</b></a></li>';}
if ($thisPage=='page1') {
echo '<li class="current"><a href="page1.htm"><b>Page 1</b></a></li>';}
else {
echo '<li><a href="page1"><b>Page 1</b></a></li>';}
if ($thisPage=='page2') {
echo '<li class="current"><a href="page2.htm"><b>Page 2</b></a></li>';}
else {
echo '<li><a href="page2"><b>Page 2</b></a></li>';}
if ($thisPage=='page3') {
echo '<li class="current"><a href="page3.htm"><b>Page 3</b></a></li>';}
else {
echo '<li><a href="page3.htm"><b>Page 3</b></a></li>';}
echo "</ul>"
?>
I've only been working in PHP for a couple months now, so my explanation is most likely cryptic; But basically each IF statement above looks for the value of variable $thisPage, and if it matches 'home', than carry out <li class="current"><a href="home.htm"><b>Home</b></a></li>, the ELSE statement basically means otherwise, if it is not, etc etc, and so if $thisPage's value is not 'home', thatn carry out <li><a href="home.htm"><b>Home</b></a></li>, so on and so forth. Others can explain better than me, but I know it works for me, helps keep my css directory bare, and is easy to edit if I choose to add more buttons.
copy
PHP Code:
<?php include("menu.php"); ?>
and paste it wherever you want your menubar to appear as well.
Best Regards
~Spine
Bookmarks