when i load up my form, before hitting submit...the form is already showing that some validating needs to be entered. for example, i set the validation to check for firstname if it's blank...
I haven't entered anything yet, and it's giving me errors before I even enter any data...what's up?
$first_name = $POST ['first_name'];
$last_name = $POST['last_name'];
$email_address = $POST['email_address'];
$username = $POST['username'];
$first_name = stripslashes ($first_name);
$last_name = stripslashes($last_name);
$email_address = stripslashes($email_address);
$username = stripslashes($username);
if ((!$first_name) || (!$last_name) || (!$email_address) || (!$username)){
echo 'You did not submit the following required information! <br />';
if(!$first_name){
echo "First Name is a required field. Please enter it below.<br />";
}
if(!$last_name){
echo "Last Name is a required field. Please enter it below.<br />";
}
if(!$email_address){
echo "Email Address is a required field. Please enter it below.<br />";
}
if(!$username){
echo "Desired Username is a required field. Please enter it below.<br />";
}
// include 'join_form.php'; // Show the form again!
/ End the error checking and if everything is ok, we'll move on to
creating the user account /
exit(); // if the error checking has failed, we'll exit the script!
}