Jump to content

Archived

This topic is now archived and is closed to further replies.

whare

if statment not sowning correct info.

Recommended Posts

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

[code]<?
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>";

}
?>[/code]

Thanx All


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

Share this post


Link to post
Share on other sites
try echoing $_SESSION['user_level'] as well as $_SESSION['username'] and see if they are both what you expect

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.