Thanks to all the previous members who have assisted me. I try not to post on here until I have exhausted all other avenues.
Just wondering if there is a way to check if multiple variables are blank.
The example below works for 1 variable but when I specify a second variable 'dob' i get the following error.
which refers to the code below.Parse error: syntax error, unexpected ',', expecting ')'
I have tried using || to separate the variables too.
Code: Select all
if (empty($_POST['name'], $_POST['dob'])){
echo 'Please fill in all required fields';
}
else {
mail($sendTo, $subject, $headers);
header("Location: success.php");
}Kind regards,
malloy