Jump to content

Error Checking Problem


navybofus

Recommended Posts

The code below is used to check my form and ensure that all of the fields are filled out. The problem is that it's always coming back saying that the password field isn't filled out. What could be wrong? I think I just need another set of eyes to read over it and catch the snag.

 

/* Check the form posted fields */

if((!$first_name) || (!$last_name) || (!$email_address) || (!$username) || (!$password)){
$req_field = 'You did not submit the following required information! <br />';
if(!$first_name){
	$req_field_first = "First Name is a required field. Please enter it below.<br />";
}
if(!$last_name){
	$req_field_last = "Last Name is a required field. Please enter it below.<br />";
}
if(!$email_address){
	$req_field_email = "Email Address is a required field. Please enter it below.<br />";
}
if(!$username){
	$req_field_user  = "Desired Username is a required field. Please enter it below.<br />";
}
        if(!$password){
	$req_field_pass  = "Desired Password is a required field. Please enter it below.<br />";
}
include 'sign_up.php'; // Show the form if error occurs

exit();
}

Link to comment
https://forums.phpfreaks.com/topic/200945-error-checking-problem/
Share on other sites

I don't know why this happens every time, but as soon as I post it here I find the problem :( Thanks for the answers and if you were interested in what was wrong it was in the form. I had misspelled the word password for the field id. Thanks again peeps :)

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.