Unwanted error message
Posted: Tue Jan 14, 2014 1:14 am
Hi everybody,
I'm a learner of PHP. Trying to learn PHP just for last few days. I've written a very short program. Unfortunately, the output is showing some error, which I can't understand. Please help me in this regard.
THE CODE
THE ERROR MESSAGE
I'm a learner of PHP. Trying to learn PHP just for last few days. I've written a very short program. Unfortunately, the output is showing some error, which I can't understand. Please help me in this regard.
THE CODE
Code: Select all
<?php
session_start();
$_SESSION['username'] = $_POST['user'];
$_SESSION['userpass'] = $_POST['pass'];
$_SESSION['authuser'] = 0;
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();
}
?>Please help anyone. Thanks in advance to all.Notice: Undefined index: user in /opt/lampp/htdocs/movie1.php on line 4
Notice: Undefined index: pass in /opt/lampp/htdocs/movie1.php on line 5