Heh.. This one's simple..
Code:
<?php
include_once("config.php");
//Check for required fields from the form
if ((!$_POST[email]) || (!$_POST[password]))
{
header("Location: ../login.php");
exit;
}
//Connect to server
$conn = mysql_connect("localhost", $username, $password) or die(mysql_error());
//Select database
mysql_select_db($database,$conn) or die(mysql_error());
//Create the query
$sql = "
select * from members
where
email = '$_POST[email]' AND password = password('$_POST[password]') AND status = '1'";
//Issue query
$result = mysql_query($sql,$conn) or die(mysql_error());
//Check the number of return rows
if (mysql_num_rows($result) == 1)
{
session_start();
$_SESSION[auth] = "1";
$_SESSION[id] = mysql_result($result, 0, 'id');
$_SESSION[fname] = mysql_result($result, 0, 'f_name');
$_SESSION[sname] = mysql_result($result, 0, 'l_name');
$_SESSION[user_email] = mysql_result($result, 0, 'email');
header("Location: ../index.php");
}
else
{
header("Location: ../login_error.php");
}
?>
No quotes around variables.. try it now.. And if there are any errors, post them..