Login redirection does not seem to work
Posted: Wed Apr 22, 2009 12:01 pm
I have a login script called login.php. When I place the following redirection lines as first lines in the script I want to execute to call my login.php if someone tries to execute it, for some reason the if condition does not get evaluated. I have spent couple of hours staring at those lines but nothing jumps out. Wondering if anyone can see the problem with that syntax:
<?
session_start();
if(! session_is_registered(myusername)){
header("location:login.php");
}
?>
<html>
<body>
Login Successful
</body>
</html>
. . .
rest of file here ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Use Only HANDLING INSTRUCTIONS PROPRIETARY - SENSITIVE</title>
<style type="text/css">
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
td.pme-navigation-0, t
<?
session_start();
if(! session_is_registered(myusername)){
header("location:login.php");
}
?>
<html>
<body>
Login Successful
</body>
</html>
. . .
rest of file here ...
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Use Only HANDLING INSTRUCTIONS PROPRIETARY - SENSITIVE</title>
<style type="text/css">
hr.pme-hr { border: 0px solid; padding: 0px; margin: 0px; border-top-width: 1px; height: 1px; }
table.pme-main { border: #004d9c 1px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
table.pme-navigation { border: #004d9c 0px solid; border-collapse: collapse; border-spacing: 0px; width: 100%; }
td.pme-navigation-0, t