mnielsen Posted June 19, 2008 Share Posted June 19, 2008 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] Link to comment https://forums.phpfreaks.com/topic/110879-more-help-urgent/ Share on other sites More sharing options...
bluejay002 Posted June 19, 2008 Share Posted June 19, 2008 something is wrong with the query or the query has less than one rows returned. not really a php issue. Link to comment https://forums.phpfreaks.com/topic/110879-more-help-urgent/#findComment-568870 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.