Hi Guys
I have a bit of a problem about a login system for a website. In the login page it should redirect to a page called admin.php but it sure don't.. Below I'll post both my admin.php and login.php files. Hope someone knows what my problem with my header() is.
Login.php:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Underside</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css">
</head>
<body>
<table>
<p style="font-size: 25px;">Log Ind</p>
<tr>
<td>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
Username:
</td><td>
<input type="text" size="25" name="usr">
</td></tr><tr>
<td>
Password:
</td><td>
<input type="password" size="25" name="pwd">
</td></tr>
</table>
<input type="submit" name="Log_Ind" value="Log Ind">
</form>
</body>
</html>
<?php
$usr = $REQUEST["usr"];
$pwd = $REQUEST["pwd"];
if($usr=="user" and $pwd=="password") {
session_start();
session_register('user');
header("location:frontpage.php?site=admin");
exit;
}
?>
admin.php
<?php
session_start();
if(session_is_registered('user'))
{
echo "You are admin";
}
else
{
header("Location:ip.php");
exit;
}
?>
Happy Debugging
Best Regards
Christian S.