macleodjb
04-25-2007, 03:20 PM
I have a navigation that is having some problems. When a user log's in they are directed to main.php. Once the user hits this page the navigation displays fine, so the user now travels to another page, at this point the navigation sometimes appears and sometimes not. If the user were to click back to main.php the navigation would not show up. The weird thing is when you view source on the document that doesn't show the navigation it will be there in the html code, it's just not visible for some reason. Here is the code that i have for this navigation.
<DIV id=leftcol>
<UL id=nav>
<?php
if(isset($_SESSION['username'])) {
$level = $_SESSION['gid'];
if ($level >=1) {
echo '<LI><a href="./main.php">Main</a></LI>';
} else {
echo '<LI>Main</LI>';
}
if ($level >=1) {
echo '<LI><A href="./add_job.php">Add Job</A></LI>';
} else {
echo '<LI>Add Job</LI>';
}
if ($level >=1) {
echo '<LI><A href="./edit_job.php">Edit Job</A></LI>';
} else {
echo '<LI>Edit Job</LI>';
}
if ($level >=1) {
echo '<LI><A href="./add_rfi.php">Add RFI</A></LI>';
} else {
echo '<LI>Add RFI</LI>';
}
if ($level >=1) {
echo '<LI><A href="./add_note.php">Add Note</A></LI>';
} else {
echo '<LI>Add Note</LI>';
}
if ($level >=2) {
echo '<LI><A href="./installation.php">Installation</A></LI>';
} else {
echo '<LI>Installation</LI>';
}
if ($level >=2) {
echo '<LI><A href="./punch_list.php">Punch Lists</A></LI>';
} else {
echo '<LI>Punch Lists</LI>';
}
if ($level >=6) {
echo '<LI><A href="./users.php">Users</A></LI>';
} else {
echo '<LI>Users</LI>';
}
} else {
echo '<LI>Login To View Nav</LI>';
}
?>
</UL>
</div>
Thanks in advance for the help
<DIV id=leftcol>
<UL id=nav>
<?php
if(isset($_SESSION['username'])) {
$level = $_SESSION['gid'];
if ($level >=1) {
echo '<LI><a href="./main.php">Main</a></LI>';
} else {
echo '<LI>Main</LI>';
}
if ($level >=1) {
echo '<LI><A href="./add_job.php">Add Job</A></LI>';
} else {
echo '<LI>Add Job</LI>';
}
if ($level >=1) {
echo '<LI><A href="./edit_job.php">Edit Job</A></LI>';
} else {
echo '<LI>Edit Job</LI>';
}
if ($level >=1) {
echo '<LI><A href="./add_rfi.php">Add RFI</A></LI>';
} else {
echo '<LI>Add RFI</LI>';
}
if ($level >=1) {
echo '<LI><A href="./add_note.php">Add Note</A></LI>';
} else {
echo '<LI>Add Note</LI>';
}
if ($level >=2) {
echo '<LI><A href="./installation.php">Installation</A></LI>';
} else {
echo '<LI>Installation</LI>';
}
if ($level >=2) {
echo '<LI><A href="./punch_list.php">Punch Lists</A></LI>';
} else {
echo '<LI>Punch Lists</LI>';
}
if ($level >=6) {
echo '<LI><A href="./users.php">Users</A></LI>';
} else {
echo '<LI>Users</LI>';
}
} else {
echo '<LI>Login To View Nav</LI>';
}
?>
</UL>
</div>
Thanks in advance for the help