navybofus Posted May 6, 2010 Share Posted May 6, 2010 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 More sharing options...
iblood Posted May 6, 2010 Share Posted May 6, 2010 have you tried to print out your password variable?? Link to comment https://forums.phpfreaks.com/topic/200945-error-checking-problem/#findComment-1054329 Share on other sites More sharing options...
kenrbnsn Posted May 6, 2010 Share Posted May 6, 2010 Can you show us your form and how the variables are getting the values? Ken Link to comment https://forums.phpfreaks.com/topic/200945-error-checking-problem/#findComment-1054330 Share on other sites More sharing options...
navybofus Posted May 6, 2010 Author Share Posted May 6, 2010 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 Link to comment https://forums.phpfreaks.com/topic/200945-error-checking-problem/#findComment-1054340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.