Sub Navigation Bar Question
Posted: Thu Jul 15, 2004 9:33 pm
Hi,
First let me say - I'm not a javascript person (and I'm barely a PHP person!) so you'll see my clear desire to avoid javascript in my code below.
Anyway, I'm working on a second level navigation menu that will only be shown based on the selection made by the user.
Here's my code:
When I load the page, nothing happens. This is my first attempt and trying to hand code anything like this, so please be gentle 
Also, I'm open to any suggestions as to better methods for going about this type of procedure.
Thanks!
First let me say - I'm not a javascript person (and I'm barely a PHP person!) so you'll see my clear desire to avoid javascript in my code below.
Anyway, I'm working on a second level navigation menu that will only be shown based on the selection made by the user.
Here's my code:
Code: Select all
<?php
ob_start();
session_start();
?>
<table width="800px" align="center" height="140px" style="height:140px;" background="images/topnavlogo.gif">
<tr>
<td colspan="9">
</td>
</tr>
<?php include ("loginbar.php");?>
</table>
<hr width="100%" color="#333333" size="1px">
<form action="<?=$_SERVER['PHP_SELF'];?>" method="POST" name="section"><table width="800px" align="center" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><input name="section" type="hidden" value="collections"><img src="images/collections.gif" />
</td>
<td align="center"><a href="/aboutav.php" onClick="<?php showSubNav();?>"><input name="section" type="hidden" value="aboutus"><img src="images/aboutus.gif" border="0" /></a>
</td>
<td align="center"><input name="section" type="hidden" value="wellbeing"><img src="images/wellbeing.gif" />
</td>
<td align="center"><input name="section" type="hidden" value="press"><img src="images/press.gif" />
</td>
<td align="center"><input name="section" type="hidden" value="fashionconsultant"><img src="images/fashionconsultants.gif" />
</td>
</tr>
</table>
</form>
<?php
function showSubNav()
{
$_SESSION['section']=$_POST['section'];
if $_SESSION['section']='collections';
{
include ("collectionssubnav.php");
}
elseif $_SESSION['section']='aboutus';
{
include ("aboutussubnav.php");
}
elseif $_SESSION['section']='wellbeing';
{
include ("wellbeingssubnav.php");
}
elseif $_SESSION['section']='press';
{
include ("presssubnav.php");
}
elseif $_SESSION['section']='fashionconsultant';
{
include ("fashionconssubnav.php");
}
else
{
}
}
?>Also, I'm open to any suggestions as to better methods for going about this type of procedure.
Thanks!