Jump to content

Form validating problems


immodium

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.