Hi,
i have a login script which makes use of sessions.
Login script
***********
session_start()
.....
.....
....
if(!empty($row["roll_no"]))
{
$_SESSION['bo_id']=$bo_id;
$_SESSION['pass']=$passw;
.....
.....
and sets the session varaibles if authentication is successful.
Then there is another script which is used to check if the user is
ADMIN
session_start();
.....
......
function isadmin()
{
if($_SESSION['bo_id'] != "ADMIN")
{
global $wwwroot;
include("style.html");
?>
<html><head><title>Must Be admin</title>
<meta http-equiv="Refresh"
content="5 ; URL=<?=$wwwroot?>/userf/login.php">
</head>
<br><br><center>
<font color="brown"><h4>Only Administerators Can Access
This Page</h4></font>
<br>You will be redirected to <a
href="<?=$wwwroot?>/userf/login.php">Login Page</a> in 5 seconds
</center></body></html>
<?
exit;
}
}
Now with the newer PHP versions(that which comes with RH9 ) all this
works perfectly.
(Register globals is off and session.auto_start is 1 )
But with older PHP versions 4.1.2 etc this script doesn't work because
$_SESSION['bo_id'] is empty in the admin authentication script(2nd
script).
But this session variable is set in the login script !!
(In old PHP versions register globals is on and session_auto_start is
off)
Can anyone plz tell me how to make this work in all PHP versions!!
Thanx
Manu