Hello everyone, I got an error from the code which I am copy-pasting from a textbook. Could you please tell me what I am doing wrong?

Here are the codes:
login.php:

<?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>

movie1.php:

<?php
//delete this line setcookie('username', 'Joe', time()+60);
session_start();
$_SESSION['username']=$_POST['user'];
$_SESSION['userpass']=$_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>

When I am entering username:Joe and password:12345 I get the following result:

Notice: Undefined index: user in C:\xampp\test\movie1.php on line 4

Notice: Undefined index: pass in C:\xampp\test\movie1.php on line 5
Sorry, but you don’t have permission to view this page, you loser!

Could you please tell me what I am doing wrong and how can I fix this?
Thank you very much

one small error i have found is:
you missed the '=' in form tag.

<form method="post" action="http://localhost/movie1.php">

Rest of the code working fine for me.

It was the reason. Thank you very much!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.