I have small issue! I current have a UserID number coming from a login page, Can I not do something like this?
This works:
session_start();
if (isset($_SESSION["UserID"])){
}
include('../includes/navAdmin.inc.php');
}
else {
header('Location: Login.php');
}
But I want to do something more like this to restrict links to certain users etc:
session_start();
if (isset($_SESSION["UserID"])){
}else if (isset($_SESSION["UserID"] === 1){ <---this one to give the "admin" the admin page etc
include('../includes/navAdmin.inc.php');
}
else {
header('Location: Login.php');
}
Seems like I can't or the syntax is wrong perhaps? Can someone point me in the right direction please?
Thanks in advance!