I Have worked out this, but when $menu is not set it does the foreach
function anyway, and desplays an error.

What Can I do to stop the foreach function from working if $menu is not

if ($menu==(introduction)) {$sub = array(
'overview.php' => 'Overview',
'moreinfo.php' => 'More Info'

#These parts are topics and there may be more than two.

if ($menu==(support)) {$sub = array(
'sitemap.php' => 'Site Map',
'contact.php' => 'Contact Us'

foreach ($sub as $link => $name) (
 $sublink .= "<li><a href='".$link."'>".$name."</a></li><br>";
<a href="?menu=introduction">Introduction</a><br>
<? $introduction; ?><br>

<a href="?menu=support">Support</a><br>
<? $support; ?>

Daniel Broome, siliconBLUE Ltd, Web Author,
Mob: 64-21-178-5120

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to