Even i thought that the problem was solved i have another problem related to the navigation menu.I would appreciate your help to solve this problem.
I am trying to put the code
PHP Code:
session_start(); if($_SESSION['username']){ echo "Welcome ".$_SESSION['username']."!". "Logon time is: ".Date("m/d/Y"); include($_SESSION['isAdmin']?'logoffheaderAdmin.php':'logoffheader.php');
in every page of the website in order to check if the user is administrator or a regular user.In two pages i manage to do it but for the rest it doesn't appear any menu regarding which user it is.
I will display an example of the code that i want the menu to appear:
PHP Code:
<? include "../dbconnect.php";
//This is the new code i add to check if the user is admin or not session_start(); if($_SESSION['username']) {echo "Welcome ".$_SESSION['username']."!". "Logon time is: ".Date("m/d/Y"); include($_SESSION['isAdmin']?'logoffheaderAdmin.php':'logoffheader.php');
/* This was what i had previous in order to display the menu for the regular user amd it was working session_start(); if (session_is_registered('username')) { echo "Welcome "."$username"."!"." Logon time is : ".Date("m/d/Y"); require("../logoffheader.php"); */
?> <form action="search1.php" method="get" name="Searchform"> <table width="100%" height="100%" border="0" bordercolor="#DCCA23" bgcolor="#DCCA23"> <tr bordercolor="#DCCA23" bgcolor="#DCCA23"> <td height="10%" colspan="2"><font size="4" face="Perpetua"> <h3><strong>Search Form </strong></h3> </td> </tr> <tr bordercolor="#DCCA23" bgcolor="#DCCA23"> <td height="10%" colspan="2"> <size="2" face="Perpetua"> <h4>Search: <input name="searchval" type="text" id="searchval" size="40"> <input type="submit" name="Search" value="Search"> </h4> </td> </tr> <tr> <td><a href="advancesearch.php">Advanced Search</a></td> </tr> </table> </form> <? } else { header("Location:http://www.domain.com/Staff"); die(); }; ?>
It is very annoying as i though i had solve it but i can't use this command.
So please anyone?
Thanks,
Xenia
|