Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.