the following code is working fine on windows server but when i run it on Linux Redhat server it goes into infinite loop:
<?
if (!session_start()) {
$chronerr->halt(22,"Session Management");
}
else {
if (!session_is_registered("loggedin") && $FileName != "login") {
header("Location: login.php");
}
else {
if (!$loggedin && $FileName != "login") {
header("Location: login.php");
}
}
}
?>
Can someone help me in pointing out the error?
Thank You.
my php code makes the system go in infinite loop
Moderator: General Moderators
-
mattpointblank
- Forum Contributor
- Posts: 304
- Joined: Tue Dec 23, 2008 6:29 am
Re: my php code makes the system go in infinite loop
If the latter two outputs of your if statement send the user to the same page, why not just combine them into one 'else' step?