Hi, I have written my login script but it wont get passed the second 'if' statement. I've tried a few ways to get it working but same result. I end back up at my index page with nothing. The file is attached.
Please discard my last topic as it is now solved.
Here;s the if statement.
else if(confirmEmailPassword($email, $password) == 1 || confirmEmailPassword($email, $password) == 2){
header("Location: /index.php?LoginError=Invalid");
}
And here's the function.
function confirmEmailPassword($email, $password){
$sql = "SELECT `password` FROM `Accounts` WHERE `email` = '$email'";
$result = mysql_query($sql);
if(!$result || (mysql_num_rows($result) < 1)){
return 1;
}
$dbarray = mysql_fetch_array($result);
$dbarray['password'] = stripslashes($dbarray['password']);
$password = stripslashes($password);
if($password == $dbarray['password']){
return 0;
}else{
return 2;
}
}
The source code is attached.
[attachment deleted by admin]