colap Posted June 21, 2011 Share Posted June 21, 2011 Suppose i have an md5-encrypted password. Now to authentication i want to check the md5-password with the given input from user. How can i do this? Quote Link to comment https://forums.phpfreaks.com/topic/239994-how-can-i-check-input-text-with-md5-password/ Share on other sites More sharing options...
AMcHarg Posted June 21, 2011 Share Posted June 21, 2011 Hash the input using the same md5 function and compare the strings. Quote Link to comment https://forums.phpfreaks.com/topic/239994-how-can-i-check-input-text-with-md5-password/#findComment-1232772 Share on other sites More sharing options...
TeNDoLLA Posted June 21, 2011 Share Posted June 21, 2011 // Check if user submitted authentication. // Could also check that they are not empty strings if wanted here. if (isset($_POST['password'])) { if (md5($_POST['password']) === $hashedPassString) { // Password matched } } Quote Link to comment https://forums.phpfreaks.com/topic/239994-how-can-i-check-input-text-with-md5-password/#findComment-1232776 Share on other sites More sharing options...
Maq Posted June 21, 2011 Share Posted June 21, 2011 There are a few examples in the manual - MD5. Quote Link to comment https://forums.phpfreaks.com/topic/239994-how-can-i-check-input-text-with-md5-password/#findComment-1232800 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.