craigerjs Posted August 1, 2010 Share Posted August 1, 2010 Hi, I have a $password that is encrypted with SHA. I have a $user_password that gets it's data from a form. How can I write an if statement comparing the two for equality? I am not sure how to make the $user_password into a SHA encrypted format within an if statement. Thanks, Craig Quote Link to comment https://forums.phpfreaks.com/topic/209525-sha/ Share on other sites More sharing options...
dezkit Posted August 1, 2010 Share Posted August 1, 2010 if(sha1($user_password) == $password){ // success } else { // failure } Quote Link to comment https://forums.phpfreaks.com/topic/209525-sha/#findComment-1093909 Share on other sites More sharing options...
craigerjs Posted August 1, 2010 Author Share Posted August 1, 2010 Thanks so much! Quote Link to comment https://forums.phpfreaks.com/topic/209525-sha/#findComment-1093918 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.