Re: Please Help - getting a hightlight depending on selected page

From: Date: Wed, 22 Aug 2001 21:59:33 +0000
Subject: Re: Please Help - getting a hightlight depending on selected page
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-63970@lists.php.net to get a copy of this message
"Martin Hughes" <martin@mixermanic.co.uk> wrote in message news:20010822210642.1116.qmail@pb1.pair.com... > OK here's the code in the page: > > <!-- Start Navigation --> > <div id="navbar"> > <table class="navtable" width="160" cellpadding="4"> > <!-- Navigation Bar Heading --> > <tr> > <td class="navhead">Welcome</td> > </tr> > <tr><td class="navtext" id="sel"><a > href="">Home</a></td></tr> > <tr><td class="navtext"><a > href="">Introduction</a></td></tr> > <tr><td class="navtext"><a href="">Changes &amp; > Cuts</a></td></tr> > <tr><td class="navtext"><a > href="">Scores</a></td></tr> > <tr><td class="navtext"><a > href="">Orchestra</a></td></tr> > <tr><td class="navtext"><a > href="">Synthesizers</a></td></tr> > <tr><td class="navtext"><a href="">Sound > System</a></td></tr> > <tr><td class="navtext"><a > href="">Articles</a></td></tr> > <tr><td class="navtext"><a href="">21st Century Les > Mis&eacute;rables</a></td></tr> > <tr><td class="navtext"><a > href="">Information</a></td></tr> > <tr><td class="navtext"><a href="">Discussion > Forums</a></td></tr> > > </table> > </div> > <!-- End Navigation --> > > > I am using this 1 page as the php 'template' with content added depending on > the url. For example, to go to the synthesizers page the url is: > index.php?sect=5&id=0&page=31 > > where sect=5 is the part that sets the menu highlight (the menu is alway the > same, hard-coded into the page - all I want to do is change the css id="sel" > from Home to Synthesizers. <div id="navbar"> <table class="navtable" width="160" cellpadding="4"> <tr><td class="navhead">Welcome</td></tr> <?php $index = array( "Home", "Introduction", "Changes &amp; Cuts", "Scores", "Orchestra", "Synthesizers", "Sound System", "Articles", "21st Century Les Mis&eacute;rables", "Information", "Discussion Forums" ); $items = count($index); for($i = 0; $i < $items; $i++) { echo "\n<tr><td class='navtext'"; if ($sect == $i) echo " id='sel'"; echo "><a href='index.php?sect=$i'>".$index[$i]."</a>"; echo "</td></tr>"; } ?> </table> </div>

« previous php.general (#63970) next »