immodium Posted March 26, 2010 Share Posted March 26, 2010 Hi heres is the code $user = $_POST['user']; $password = md5($_POST['password']); $email = $_POST['email']; if (!$user) { echo "Username needs to be entered"; include 'register.html'; unset($user, $password, $email); exit(); } if (!$password) { echo "Password needs to be entered"; include 'register.html'; unset($user, $password, $email); exit(); } if (!$email) { echo "Email needs to be entered"; include 'register.html'; unset($user, $password, $email); exit(); } the problem i'm getting is that if i type in a username and email and leave the password field blank the form still gets processed. The only difference in the html code for the form is that the password input type is password not text. Any ides why its still getiing processed with a blank form field? Thanks in advance. Olly Link to comment https://forums.phpfreaks.com/topic/196606-form-validating-problems/ Share on other sites More sharing options...
PFMaBiSmAd Posted March 26, 2010 Share Posted March 26, 2010 The md5() of an empty value is an MD5 value. You should validate the entered data first, then use md5() on the entered password. Link to comment https://forums.phpfreaks.com/topic/196606-form-validating-problems/#findComment-1032254 Share on other sites More sharing options...
immodium Posted March 26, 2010 Author Share Posted March 26, 2010 ahh get it. thanks. I'll give it a whirl. Link to comment https://forums.phpfreaks.com/topic/196606-form-validating-problems/#findComment-1032257 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.