I went throught the process you said and it is still not working when you refresh. I am using version 4.2.2 of php, and globals are on. I don't know if that makes a difference.
Here are the changes I have made and it still requires a refresh:
<?PHP
//Validate.php
//everything is the same except include("Enter.php")
//instead of Admin.php
if($checklogin > 0){
while($row = mysql_fetch_array($sql)){
foreach( $row AS $key => $val ){
$$key = stripslashes( $val );
}
session_register('AccessLevel');
$AccessLevel = $_SESSION['AccessLevel'];
session_register('UserName');
$UserName = $_SESSION['UserName'];
session_register('UserFName');
$UserFName = $_SESSION['UserFName'];
}//end while
//I changed this, the rest is the same
include("Enter.php");
}
?>
<?PHP
//Enter.php
//I added this, before it went to Admin.php
<?PHP
session_start();
include("AdminLogin.html");
$AccessLevel = $_SESSION['AccessLevel'];
$UserName = $_SESSION['UserName'];
$UserFName = $_SESSION['UserFName'];
echo "Enter Admin Area <a href=Admin.php> HERE </a><br>";
?>
//Admin.php is the same
As you can see I am using
1.Validate.php to post variables to the form, then verify the username and password.
2.Then Enter.php gives them a link to Admin.php
3. Admin php checks access level and lists privileges
Admin.php doesn't work unless I refresh the page at step 2.
I have spent a long time with this seemingly small problem but it just doesn't work. Does anyone have any ideas???? I would really appreciate it!