Help with chapter 9
OK, I've gotten everything to run except the creat_users.php when the restict access block is added. I'm using the code I downloaded from this site, changed the MySQL info for my server and when I login and try to go to the create_users.php it sends me back to the menu.php page. I'm not sure where the error is.
This is the code block :
<?php
session_start();
// Check the Users status, if not Admin level
// redirect back to the menu.php page
if($HTTP_SESSION_VARS["statusCheck"] != "Admin")
header("Location: menu.php");
?>
and here is the code block that creates the session on the login page.
<?php
// This section is only run when the form has been submitted
if($HTTP_POST_VARS['Submit']=="Login"){
session_start();
// Check whether the login details are correct, and put
// the user status into a session variable.
$statusCheck = check_login($HTTP_POST_VARS);
if ($statusCheck == "Admin" || $statusCheck == "Staff"){
session_register("statusCheck");
header("Location: menu.php");
}
}
?>
thanks. Liked the book by the way.
|