I am generating a PHP error with this function but don't know why.
Little help...
function Validate_Page_Nav($LastPage, $ErrorPage) {
if($_SESSION['Staff_ID']) {
$trimmed = str_replace($staffroot, '', $_SERVER['SCRIPT_NAME']);
$resul = $db->query("SELECT * FROM Page_Access WHERE URI = '$trimmed'") or die("failed to get access data");
$page_access = $resul->fetch_assoc();
$URI_access = explode(",", $page_access['User_Level']);
if(in_array($_SESSION['Staff_level'], $URI_access)) {
if($_SESSION['Last_Page'] != $LastPage) {
header("location: {$ErrorPage}?message=Unable to update user information.");
exit();
}
}
$_SESSION['Last_Page'] = $trimmed;
}
}
Validate_Page_Nav("user_list.php","user_list.php");