Jump to content

md5() password


ballhogjoni

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.