Hey everyone,
So I have another admin redirect problem. I have a file for user functions and login check/if exists..ect so the other redirect set of PHP paramaters won't work and all I want to do is redirect a user to access a page based on user_level. Whether the user_level is = 1 or = 0. I'm not sure what everyone needs needs to help me figure this out and to understand why it the way it needs to be but here it is:
if(!logged_in()){
header('Location: index.php');
exit();
}
if(!isset($_SESSION['user_level'])) {
echo 'You are not allowed to access this page. Click <a href="index.php">here</a> to go back to the home page';
exit();
}elseif(1 == (int)$_SESSION['user_level']){
header('Location: create_album.php');
exit;
}
I keep getting the message "You are not allowed to access this page..ect." and I get that respose for all users regardless of if the integer is 1 or 0 in the user_level field. Any Ideas? I've tried the var_dump SESSION and this is what I got as a result on the page "array
'user_id' => string '2' (length=1)"
Thanks for any help once again!
-Geneh23