i keep having a problem, ive used the right usename and password but it still says "Sorry,you dont have permission to view this page, you loser"
I've checked a few times but i can't find anything different from than in the book...
movie1.php
Code:
<?php
session_start();
$_SESSION['username']=$_POST['user'];
$_SESSION['username']=$_POST['pass'];
$_SESSION['authuser']=0;
//Check username and password information
if (($_SESSION['username']== 'Joe') AND
($_SESSION['userpass']== '12345'))
{
$_SESSION['authuser']=1;
}
else
{
echo "Sorry, but you don't have permission to view this page, you loser!";
exit();
}
?>
<html>
<head>
<title>Find my Favorite Movie!</title>
</head>
<body>
<?php
$myfavmovie=urlencode("Life of Brian");
echo "<a href='http://localhost/moviesite.php?favmovie=$myfavmovie'>";
echo "Click here to see information about my favorite movie!";
echo "</a>";
?>
</body>
</html>
login.php
Code:
<?php
session_unset();
?>
<html>
<head>
<title>Please Log In</title>
</head>
<body>
<form method="post" action="http://localhost/movie1.php">
<p>Enter your username:
<input type="text" name="user">
</p>
<p>Enter your password:
<input type="password" name="pass">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>