Jump to content


Photo

if statment not sowning correct info.


  • Please log in to reply
1 reply to this topic

#1 whare

whare
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 28 August 2006 - 06:35 PM

Hi all

Right my if statment is not showing what it should do now with the code below my access level is "6" but it is showing my access as "0" any ideas why that would be

And befor anybody says anything this file is used as an include so session_start(); is in the file that this one is being called to

<?
include 'roster/config.php';

if(isset($_SESSION["fullname"])) {

echo "<p align='center'><BR><font face=\"Arial\" size=\"2\" color=\"#FFFFFF\"><b>Welcome<br />". $_SESSION

['fullname'] ." </font></b>";

if($_SESSION['user_level'] == 0){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><img border='0' 

src='images/tmenu/tblank.gif' width='100' height='20'><a href='eacc.php'><img border='0' 

src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/tendb.gif' width='100' height='20'>0";
}
if($_SESSION['user_level'] == 1){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><img border='0' 

src='images/tmenu/tblank.gif' width='100' height='20'><a href='eacc.php'><img border='0' 

src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/tendb.gif' width='100' height='20'>1";
}
if($_SESSION['user_level'] == 2){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><a href='eacc.php'><img 

border='0' src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/admin.gif' width='100' height='20'><a 

href='aflight.php'><img border='0' src='images/tmenu/aaflight.gif' width='100' height='20'></a><a 

href='eflight.php'><img border='0' src='images/tmenu/aeflight.gif' width='100' height='20'></a><img border='0' 

src='images/tmenu/tendb.gif' width='100' height='20'>2";
}
if($_SESSION['user_level'] == 3){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><a href='eacc.php'><img 

border='0' src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/admin.gif' width='100' height='20'><a 

href='aac.php'><img border='0' src='images/tmenu/aac.gif' width='100' height='20'></a><a href='eac.php'><img 

border='0' src='images/tmenu/aeac.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tendb.gif' 

width='100' height='20'>3";
}
if($_SESSION['user_level'] == 4){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><img border='0' 

src='images/tmenu/tblank.gif' width='100' height='20'><a href='eacc.php'><img border='0' 

src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/tendb.gif' width='100' height='20'>4";
}
if($_SESSION['user_level'] == 5){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><a href='eacc.php'><img 

border='0' src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/admin.gif' width='100' height='20'><a 

href='aflight.php'><img border='0' src='images/tmenu/aaflight.gif' width='100' height='20'></a><a 

href='eflight.php'><img border='0' src='images/tmenu/aeflight.gif' width='100' height='20'></a><a 

href='aac.php'><img border='0' src='images/tmenu/aac.gif' width='100' height='20'></a><a href='eac.php'><img 

border='0' src='images/tmenu/aeac.gif' width='100' height='20'></a><a href='user.php'><img border='0' 

src='images/tmenu/auser.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tendb.gif' 

width='100' height='20'>5";
}
if($_SESSION['user_level'] == 6){
	echo "<img border='0' src='images/tmenu/tendmenu.gif' width='100' height='20'><a href='eacc.php'><img 

border='0' src='images/tmenu/meditac.gif' width='100' height='20'></a><a href='pirep.php'><img border='0' 

src='images/tmenu/mpirep.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tblank.gif' 

width='100' height='20'><img border='0' src='images/tmenu/admin.gif' width='100' height='20'><a 

href='aflight.php'><img border='0' src='images/tmenu/aaflight.gif' width='100' height='20'></a><a 

href='eflight.php'><img border='0' src='images/tmenu/aeflight.gif' width='100' height='20'></a><a 

href='aac.php'><img border='0' src='images/tmenu/aac.gif' width='100' height='20'></a><a href='eac.php'><img 

border='0' src='images/tmenu/aeac.gif' width='100' height='20'></a><a href='user.php'><img border='0' 

src='images/tmenu/auser.gif' width='100' height='20'></a><img border='0' src='images/tmenu/tendb.gif' 

width='100' height='20'>6";
}

} else {

echo "<p align=\"center\"><form method='POST' action='roster/check.php'><font face=\"Arial\" size=\"2\" 

color=\"#FFFFFF\"><b><BR>Username:<BR></b></font><font face=\"Arial\" size=\"2\"><b><input type=\"text\" 

name=\"username\" size=\"10\" style=\"background-color: #800000; color: #FFFFFF; border: 1 solid 

#FFFFFF\"></b></font><font face=\"Arial\" size=\"2\" color=\"#FFFFFF\"><b><BR>Password:<BR></b></font><font 

face=\"Arial\" size=\"2\"><b><input type=\"password\" name=\"password\" size=\"10\" style=\"background-color: 

#800000; color: #FFFFFF; border: 1 solid #FFFFFF\"><BR><BR></b></font><b><font face=\"Arial\" size=\"2\" 

color=\"#FFFFFF\"><input type=\"submit\" value=\"Submit\" name=\"B1\" style=\"background-color: #800000; color: 

#FFFFFF; font-family: arial; font-size: 10pt; font-weight: bold; border: 1 solid #FFFFFF\"></font></b></form>";

}
?>

Thanx All


P.S it does show $_SESSION['fullname'] correctly so im at a loss :)

#2 AdRock

AdRock
  • Members
  • PipPipPip
  • Advanced Member
  • 911 posts

Posted 28 August 2006 - 07:17 PM

try echoing $_SESSION['user_level'] as well as $_SESSION['username'] and see if they are both what you expect
If your topic has been solved, please mark the topic as SOLVED.

This helps others from identifying which topics need help still




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users