View Single Post
Old 10-04-2007, 05:10 PM   #3 (permalink)
Capo64
Contributing Member
 
Join Date: 06-11-07
Posts: 153
iTrader: 0 / 0%
Latest Blog:
None

Capo64 is on the right pathCapo64 is on the right pathCapo64 is on the right path
You can do this with PHP by altering your code a little. I'll just show you a quick example (I'm not testing this so I'm not positive that it works but something very similar).

Code:
<?php $links = array(); $links['home'] = "http://www.mysite.com"; $links['page1'] = "http://www.mysite.com/page1.html"; $links['page2'] = "http://www.mysite.com/page2.html"; ?> <div id="wrapper"> <ul> <?php foreach ($links as $key=>$link) { $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $id = (strtolower($link) == strtolower($url)) ? " id=\"current\"" : ""; echo "<li$id>$key</li>"; } ?> </ul> </div>
I'm guessing you had each of these <li>'s link to a page so I included URLs in the array.

Last edited by Capo64 : 10-04-2007 at 05:22 PM.
Capo64 is offline   Reply With Quote