0

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");
2
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by darkagn
0

Has your session started correctly before the call to your function? Check by echo'ing $_SESSION["Last_Page"] and make sure it's what you expect.

What error message do you generate?

0

Has your session started correctly before the call to your function? Check by echo'ing $_SESSION["Last_Page"] and make sure it's what you expect.

What error message do you generate?

The Session is reading correctly.

I am not certain how to display the ERROR. Is there some code I can insert to display PHP errors? All I get is a BLANK white screen.

0

Sorry for the late reply, I was at work and got distracted doing, well work :P Well your code looks ok to me, could it be that the problem lies in user_list.php with retrieving the $_GET["message"] variable? The only other thing I can think of is that the user level is ok for the access you are trying to attain?

If you don't see error messages in your browser then you aren't actually generating an error, it's just not doing what you want :P

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.