wizzan Posted February 27, 2014 Share Posted February 27, 2014 (edited) Hello I was wondering what you add to this code to make it use md5 hash password (strPasswd) <span class="textredlg"><b>Login to the ACP</b></span><br /><br /><form action="./?page=store_acp" method="post"><table align="center" width="100%"> <tr> <td>Username:</td> <td><input type="text" name="strAccountID" value="" /></td> </tr> <tr> <td>Password:</td> <td><input type="password" name="strPasswd" value="" /> <input type="submit" value="Login!" /></td> </tr> <tr><td colspan="2" height="5"></td></tr> <tr> <td colspan="2" style="font-size: 9pt;"><%ERROR%></td> </tr></table></form> Regards Edited February 27, 2014 by wizzan Quote Link to comment https://forums.phpfreaks.com/topic/286565-md5-hashed-password/ Share on other sites More sharing options...
WebStyles Posted February 27, 2014 Share Posted February 27, 2014 To that code, there's really nothing you can add to do it. You need to hash the password after the user posts the form. Somewhere in your code there's something like $_POST['strPasswd'] to grab that value and hash it, you would do something like this: $hashedPassword = md5(trim($_POST['strPasswd'])); Hope this helps Quote Link to comment https://forums.phpfreaks.com/topic/286565-md5-hashed-password/#findComment-1470872 Share on other sites More sharing options...
requinix Posted February 27, 2014 Share Posted February 27, 2014 Don't use MD5 for passwords. Not salted, not repeatedly hashed, not anything using MD5. Or SHA1. Neither of them are secure enough to use with passwords, and haven't been for years now. Upgrade to PHP 5.5 if you can: it has functions like password_hash so you don't have to worry about password hashing. If you can't, there's a PHP version of it you can download and use. Quote Link to comment https://forums.phpfreaks.com/topic/286565-md5-hashed-password/#findComment-1470877 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.