Hi! I am having trouble in checking userlevel at the time of login. The pages set for admin level are not displayed if the user is not admin, but admin cant access the pages either!!:D Please solve my problem!
My code is:
<?php
if(!isset($_SESSION['userlevel']) || empty($_SESSION['userlevel']))
{
if ($_SESSION['userlevel'] == 2)
{
echo "ADMIN";
}
else
{
header('Location:index.php?query=notadmin');
}
}
?>