The following is nearly pretty much copied out of a book.. yet the user variable is blank. IE, in the second file, "echo $_Post['user'];" outputs nothing even though I inputted something. Am I doing something wrong?
George
George
Code:
<?php
session_unset();
?>
<html>
<head>
<title>Please Log In</title>
</head>
<body>
<form method="post" action="page2.php">
<p>Enter your username:
<input type="text" name="user">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</body>
</html>
Code:
<?php
session_start();
$_SESSION['username'] = $_Post['user'];
$_SESSION['authuser'] = 0;
if ($_SESSION['username'] == 'George') {
$_SESSION['authuser'] = 1;
} else {
echo "Sorry, no permission";
echo $_Post['user'];
exit();
}
?>
<html>
<head>
<title>Title</title>
</head>
<body>
<?php
echo "Welcome";
?>
</body>
</html>