Processing Login with DB
Posted: Sat Feb 04, 2006 9:39 pm
Hello,
I have a login form that gets processed to see if the user and password match up and exist in the DB.
this is my processor
I am getting this parse error
I have a login form that gets processed to see if the user and password match up and exist in the DB.
this is my processor
Code: Select all
<?
error_reporting(E_ALL);
$username= "muot_users";
$password= "users";
$database= "muot_users";
mysql_connect('localhost',$username,$password) or die(mysql_error());
mysql_select_db($database) or die(mysql_error());
exit();
session_start();
if (empty($_POST['user']) || empty($_POST['pass']))
header("Location:/newsite/login/login1.php");
//rather than checking for a particular user, check if the user exists in a database
$query = "SELECT * FROM users where username = '".mysql_real_escape_string($_POST['user'])."' AND `password` = password('".mysql_real_escape_string($_POST['pass'])."')";
$result = mysql_query($query);
if (!$result) die(mysql_error());
if(mysql_num_rows($result) < 0)
//if ($_POST['user'] == 'nicky' && $_POST['pass'] == 'nickypass')
{
$_SESSION['log'] = true;
//echo '<meta http-equiv="refresh" content="0;url=secure_page.php">';
}
else
?>Line 11 isParse error: parse error, unexpected T_STRING in /home/muot/public_html/newsite/login/login.php on line 11
header("Location:/newsite/login/login1.php");