I have trying to send a form and its details as an email to a site I have
created. I have written a code that will test if a particular field has
been left empty. If so it will ask the client to go back and fill it. And
that is the problem. The code is given below. The names with $ sign in
front are text boxes from the previous page. The code below is in a
different page to the one with the form.
echo "One of the fields marked with the asterix has not been filled.\n";
echo "Please click on the back button on the browser to enter the details."
$mail_subject = "New!";
$mail_body = "First name: $1stname;\n";
$mail_body .= "$surname;\n";
$mail_body .= "$spouse1st;\n";
$mail_body .= "$spousesur;\n";
if(mail($mail_to, $mail_subject, $mail_body))
echo "Successfully sent the e-mail \"$mail_subject\" to $mail_to.";
else echo "Failed to send the e-mail \"$mail_subject\"."
Thanks for your help