margaux Posted November 21, 2011 Share Posted November 21, 2011 I can't get the login script to work properly. When the account has been activated and the user then tries to login, the error message "The email address and password do not match those on your account or you have not activated your account." I removed the code 'AND active IS NULL' and I was able to get the script working properly. In the d/b, the active field is blank. Here's the relevant code from the login.php file: $q = "SELECT user_id, firstName, user_level FROM users WHERE (email='$e' AND pass=SHA1('$p')) AND active IS NULL"; and the code from the activate.php file: $q = "UPDATE users SET active=NULL WHERE (email='" . mysqli_real_escape_string($dbc, $em) . "' AND active='" . mysqli_real_escape_string($dbc, $ac) . "') LIMIT 1"; Any suggestions where I am going wrong? Thanks Link to comment Share on other sites More sharing options...
Larry Posted November 21, 2011 Share Posted November 21, 2011 I suspect your active column is set to NOT NULL, so it's value ends up being an empty string, not null, when the user activates the account. Link to comment Share on other sites More sharing options...
margaux Posted December 10, 2011 Author Share Posted December 10, 2011 that seems to have done the trick, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts