Ok this is my code so far. however i get an error on line 23 and im not sure how to resolve.
<?php
//check for required fields from the form
if ((!$POST[username]) || (!$POST[password])) {
header("Location: login.php");
exit;
}
//connect to server and select database
$conn = mysql_connect("localhost", "root", "blah") or die(mysql_error());
mysql_select_db("members",$conn) or die(mysql_error());
//create and issue the query
$sql = "select email from users where username = '$_POST[username]' AND password =
'$_POST[password]';
$result = mysql_query($sql,$conn) or die(mysql_error());
//get the number of rows in the result set
if (mysql_num_rows($result) == 1) {
//if authorized, get the values
$username = mysql_result($result, 0, 'username');
//set authorisation cookie
setcookie("auth", "1", 0, "/", "localhost", 0);
//prepare message for printing, and user menu
$msg = "<P>$f_name $l_name is authorised!</p>";
$msg .= "<P>Authorised Users' Menu:";
$msg .= "<ul><li><a href=\"member.php\">secret page</a></ul>";
} else {
echo "not working";
//redirect back to login form if not authorised
//header("Location: login.php");
//exit;
}
?>
Please help