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 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 } 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! Link to comment https://forums.phpfreaks.com/topic/209525-sha/#findComment-1093918 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.