Hi guys,
Need a little brain power from all of you, I have trying to create data entry interface for myself. But am running into a little problem with the navigation. The navigation is on the left hand side, and if one of the navigation is clicked the content should be shown on the right hand side. But if I click one of the navigation links, the content is being shown, but the navigation disappears, I know why this is happening but can't figure out how to get around it. The code is below:-
http://www.adnan-alam.com/login.php
username: adnan
password: adnan
//------------------------------------------------------------------------------------------------------------------------
//<<-------------This is checks for the priority of the user, and calls the proper navigation fucntion.
//------------------------------------------------------------------------------------------------------------------------
<table width="680">
<tr>
<td width="207" height="233"><font size="3" face="Garamond">
<?php
if (session_is_registered ("valid_user"))
{
switch ($priority["priority"])
{
case 'sadmin':
//include ("sadmin.php");
sadmin ($valid_user); //<<-------Calls the navigation function
break;
case 'admin':
//include ("admin.php");
break;
case 'normal':
//include ("normal.php");
break;
}
}
//--------------------------------------------------------------------------------------------------------------------
//<<-------This function is being called for "sadmin", this is the navigation function,
//<<-------Each of the links have query strings so, that it calls this login.php script again, and
//<<-------use a switch statement to show the appropiate content.
//--------------------------------------------------------------------------------------------------------------------
function sadmin ($valid_user)
{
if (session_is_registered ("valid_user"))
{
echo "<table align=center width=210 border=1 bordercolor=#FFFFFF>";
echo "<tr>";
echo "<td><font face=Garamond color=#999999 size=3>Wat's Up ".$valid_user.".<br></td>";
echo "</tr>";
echo "<tr>";
echo "<td><font face=Garamond color=#999999 size=3><a href=\"login.php?select=6000\">Edit</a><br></td>";
echo "</tr>";
echo "<tr>";
echo "<td><font face=Garamond color=#999999 size=3><a href=\"login.php?select=6001\">Mail</a><br></td>";
echo "</tr>";
echo "<tr>";
echo "<td><font face=Garamond color=#999999 size=3><a href=\"login.php?select=6002\">New User</a><br></td>";
echo "</tr>";
echo "<tr>";
echo "<td><font face=Garamond color=#999999 size=3><a href=\"logout.php\">Logout</a><br></td>";
echo "</tr>";
echo "</table>";
}
else
{
echo "<p align=center><font size=3 color=#FF0000 face=Garamond color=#FF0000>You have been logged out!</font></p>";
}
}
?>
</font>
<p> </p>
<p> </p>
</td>
<td width="10" height="233"><font size="3" face="Garamond"><img src="vertical-dot.gif" width="9" height="233"></font></td>
<td width="447" height="233"> <div align="center">
//----------------------------------------------------------------------------------------------------------------------------------------
//<<------The form is shown again if the session is not registered, and if the username, password is not valid.
//----------------------------------------------------------------------------------------------------------------------------------------
<?php
if (!(session_is_registered ("valid_user")))
{
if (isset ($username))
{
echo "<p align=center><font size=3 color=#FF0000 face=Garamond color=#FF0000>Username or Password entered is invalid!</font></p>";
}
else
{
echo "<p align=center><font size=3 color=#666666 face=Garamond>Please enter your username and password to login.</p></font>";
}
?>
<form action="login.php" method=post>
<table width="200">
<tr>
<td width="175"><div align="justify"><font color="#999999"><strong><font face="Garamond"> </font><font color="#999999"><strong><font face="Garamond"> </font></strong></font><font face="Garamond">
username </font></strong></font></div></td>
<td width="175"><div align="justify">
<input type="text" name="username" size="20" style="font-family: Garamond; font-size: 8pt; color: #999999; letter-spacing: 2; border-style: solid; border-width: 1">
</div></td>
</tr>
<tr>
<td width="175"><div align="justify"><font color="#999999"> <strong><font face="Garamond">
password</font></strong></font></div></td>
<td width="175"><div align="justify">
<input type="password" name="password" size="20" style="font-family: Garamond; font-size: 8pt; color: #999999; letter-spacing: 2; border-style: solid; border-width: 1">
</div></td>
</tr>
<tr>
<td colspan="2"><div align="left">
<input type="submit" value="submit" style="border:1px solid #999999; color: #999999; font-family: Garamond; font-size: 14; padding: 0; background-color: #FFFFFF; letter-spacing:2">
</div></td>
</tr>
</table>
</form>
<?php
}
else
{
//-----------------------------------------------------------------------------
//<<------Switch's on the qery strings from the navigation links.
-------------------------------------------------------------------------------
switch ($select)
{
case 6000:
echo "Hello!";
break;
case 6001:
echo "why doesn't this thing work!";
break;
case 6002:
echo "please work!";
break;
}
}
?>
</div></td>
</tr>
</table>