I have a job application form returning a person’s details among other things.
Right now, these are returned on separate lines. And if there are no entries in any field, there is a blank line in the email that is sent.
I’d like to make an IF statement so that if there is no entry in any field, it will return “Not Applicable” in the mail.
example:
$nrel1 = $_POST['nrel1'];
$nrel11_name = $_POST['nrel1_name'];
$nrel1_age = $_POST['nrel1_age'];
$nrel1_gender = $_POST['nrel1_gender'];
$nrel1_education = $_POST['nrel1_education'];
$nrel2_employment = $_POST['nrel2_employment'];
Now if the applicant makes no entry in the $nrel1_age field, I want it to return “Not Applicable” in the mail.
It’s good to check both
isset()and!empty(). If you don’t check forisset()then you may get “PHP Notice: Undefined index” warnings.