Since we don't know exactly what you're looking for, I'm just going to dump some code... 🙂
This is what the code for my banner buttons looks like:
<ul>
<li class="<?php echo $index; ?>"><a href="index.php">Home</a></li>
<li class="<?php echo $partner; ?>"><a href="/partners/">Partners</a></li>
<li class="<?php echo $product; ?>"><a href="/products/">Products</a></li>
<li class="<?php echo $admin; ?>"><a href="/admin/">Admin</a></li>
<li class="<?php echo $finance; ?>"><a href="/financial.php">Financial</a></li>
</ul>
Pretty simple, huh? Most of the work is done with the CSS file:
li.normal {
display: inline;
float: left;
padding: 4px 2px 0 0;
margin: 0 0 0 2px;
height: 24px;
width: 101px;
background: #000000 url(images/redtab.png) top left no-repeat;
text-align: center;
}
li.selected {
display: inline;
float: left;
padding: 4px 2px 0 0;
margin: 0 0 0 2px;
height: 24px;
width: 101px;
background: #000000 url(images/redtab_s.png) top left no-repeat;
text-align: center;
}
You can see that the list item "class" is determined by some PHP code which checks the URL of the page you are on. The background image for the CSS class "selected" is a slightly-more depressed 3-D tab than the "normal" tab. The only disadvantage here is that I've set a static tab width, but that keeps the CSS simple.
The code to check which folder you are in consists of:
// This statement returns the current URL...
$url_string = $_SERVER['PHP_SELF'];
// This statement limits the URL string to a fixed, testable substring...
$url_folder = substr($url_string, 6, 4);
// The switch statement...
switch($url_folder)
{
case "admi":
$index = "normal";
$partner = "normal";
$product = "normal";
$admin = "selected";
$finance = "normal";
break;
case "fina":
.
.
.
etc...
}
There's probably a more efficient way to do the same thing with a binary array, but that's just how I did it on the fly.