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

From: 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&eacute;rables" => array ("About Les Mis&eacute;rables"), "Introduction" => array ("About Les Mis&eacute;rables"), "Changes &amp; Cuts" => array ("About Les Mis&eacute;rables"), "Scores" => array ("About Les Mis&eacute;rables"), "Orchestra" => array ("About Les Mis&eacute;rables"), "Synthesizers" => array ("About Les Mis&eacute;rables"), "Sound System" => array ("About Les Mis&eacute;rables"), "Articles" => array ("About Les Mis&eacute;rables"), "21st Century<br />Les Mis&eacute;rables" => array ("About Les Mis&eacute;rables"), "Information" => array ("About Les Mis&eacute;rables"), "Discussion Forums" => array ("About Les Mis&eacute;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-)

« previous php.general (#64294) next »