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; } Link to comment https://forums.phpfreaks.com/topic/61910-md5-password/ 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']); Link to comment https://forums.phpfreaks.com/topic/61910-md5-password/#findComment-308285 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.