Re: Please Help - getting a hightlight depending on selected page
| From: | Martin Hughes | Date: | Fri, 24 Aug 2001 17:10:09 +0000 |
| Subject: | Re: Please Help - getting a hightlight depending on selected page | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-64294@lists.php.net to get a copy of this message | ||
Sorry Hugh - didn't mean to send it just to you!!
Hi!
Thanks for the help!
It works great, but I've now made the array 2 dimensional:
<?php
$index = array (
"The Music Behind<br />Les Misérables" => array ("About Les
Misérables"),
"Introduction" => array ("About Les Misérables"),
"Changes & Cuts" => array ("About Les Misérables"),
"Scores" => array ("About Les Misérables"),
"Orchestra" => array ("About Les Misérables"),
"Synthesizers" => array ("About Les Misérables"),
"Sound System" => array ("About Les Misérables"),
"Articles" => array ("About Les Misérables"),
"21st Century<br />Les Misérables" => array ("About Les
Misérables"),
"Information" => array ("About Les Misérables"),
"Discussion Forums" => array ("About Les Misérables")
);
?>
(they're not all the same - it's just for quick tesing purposes!)
Now in the nav menu I get:
Warning: Undefined offset: 0 in E:\inetpub\wwwroot\index.php on line 103
>
Warning: Undefined offset: 1 in E:\inetpub\wwwroot\index.php on line 103
>
Warning: Undefined offset: 2 in E:\inetpub\wwwroot\index.php on line 103
>
Warning: Undefined offset: 3 in E:\inetpub\wwwroot\index.php on line 103
>
etc... down to "10"
the rest of the script is:
<?php
$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&id=0'>".$index[$i]."</a>";
<-------- LINE 103
echo "</td></tr>";
}
?>
is it something to do with the "count($index)"?
Thanks for all the help!
Martin-)