dominatrix Posted January 15, 2007 Share Posted January 15, 2007 Hi guys, i've been writing a site that includes a login feature but i've encountered a problem when it comes to logging in.When registering i've set up the password variable as $registerpassword=md5(addslashes($_POST['password']));which all works fine, then when i've written the login page with $loginpassword=md5(addslashes($_POST['password']));now, i've gone through the whole lot putting echo instructions for every if statement to see where it is messing up, and it is always failing at authenticating the username &/or password. I eventually found the source of the problem, when i copy the md5 hash from phpmyadmin, remove the md5 instruction in the login page so it looks like this:$loginpassword=addslashes($_POST['password']);and then login using the password i copied from the mysql database, it logs in fine... leading me to some strange suspicion that the md5 encryption is screwing up some how. I've tried re-registering many times, made sure all the variables are working fine and removing the hashing on the registering page and it all leads back to the md5 encryption on the login page...have you guys got any ideas?cheers, dominatrix[color=white]what a shit first post :/[/color] Link to comment https://forums.phpfreaks.com/topic/34191-md5-encryption-problems/ Share on other sites More sharing options...
dominatrix Posted January 15, 2007 Author Share Posted January 15, 2007 OK, worked out the problem...always remember when you make a mysql table that MD5 hashes no matter how long the password is requires 32 characters... not 25 like i stupidly made. Link to comment https://forums.phpfreaks.com/topic/34191-md5-encryption-problems/#findComment-160876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.