ballhogjoni Posted July 26, 2007 Share Posted July 26, 2007 I am md5() my users passwords into my db. I have a login page and when the user puts his password in it doesn't match up. If I put the encode password in, it does match up. Can someone direct me to what I am doing worng? code to encode password: $_POST['passwd'] = md5($_POST['passwd']); code to login: $sql = mysql_query("SELECT password FROM users WHERE username = '$username'"); $fetch_em = mysql_fetch_array($sql); $numrows = mysql_num_rows($sql); if($numrows != 0 & $password == $fetch_em["password"]) { $valid_user = 1; } else { $valid_user = 0; } Quote Link to comment Share on other sites More sharing options...
Fadion Posted July 26, 2007 Share Posted July 26, 2007 instead of this: $_POST['passwd'] = md5($_POST['passwd']); maybe u mean: $password = md5($_POST['passwd']); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.