"Martin Hughes" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 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>




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to