Hi
I am trying to set up a login for my customers. I Have placed the code below, the problem is I am not 100% sure how to set it up so it checks the username and password are exactly what is set in the database.
I have tried it by deliberetly entering a wrong password for a username but is still logs in and sets the username in the session id . Any ideas how to fix this.
username is the emailaddress
<?php
$emailaddress = $HTTP_POST_VARS['emailaddress'];
$password = $HTTP_POST_VARS['password'];
if ( $emailaddress && $password)
{
$db = mysql_connect (, , );
mysql_select_db ('db76275624');
$sql = "SELECT emailaddress FROM customers Where emailaddress = ".$emailaddress." && password = ".$password."";
$result = mysql_query($sql);
echo "logged in";
$HTTP_SESSION_VARS['emailaddress'] = $emailaddress;
}
else
{
echo "not logged in";
}
?>