This form was working just fine, and then for some strange reason it stopped sending emails to me. I must have done something to it, but I have no idea what I did to stop it from working. The email address is valid, it just won’t send the form data to me. Here is the code.
[php]<?php
/* Check to see if the html was sent via $_POST /
if ($_SERVER[“REQUEST_METHOD”] == “POST”){
/ If true we continue on with the script /
/ Subject and Email Variables */
$emailSubject = '2017 Windemuth Family Reunion Registration Form';
/* Gathering Data Variables */
/*compare the email address */
if($_POST['email'] != $_POST['confirm']) {
#set error...
$error .= 'The email addresses do not match, please correct and submit again<br>';
}
$Descendant_First_Name = $_POST['descendant_first_name'];
$Descendant_Middle_Name = $_POST['descendant_middle_name'];
$Descendant_Surname = $_POST['descendant_surname'];
$S_SO_First_Name = $_POST['s_so_first_name'];
$S_SO_Middle_Name = $_POST['s_so_middle_name'];
$S_SO_Last_Name = $_POST['s_so_last_name'];
$Child1_First_Name = $_POST['child1_first_name'];
$Child1_Middle_Name = $_POST['child1_middle_name'];
$Child1_Last_Name = $_POST['child1_last_name'];
$Child2_First_Name = $_POST['child2_first_name'];
$Child2_Middle_Name = $_POST['child2_middle_name'];
$Child2_Last_Name = $_POST['child2_last_name'];
$Child3_First_Name = $_POST['child3_first_name'];
$Child3_Middle_Name = $_POST['child3_middle_name'];
$Child3_Last_Name = $_POST['child3_last_name'];
$Child4_First_Name = $_POST['child4_first_name'];
$Child4_Middle_Name = $_POST['child4_middle_name'];
$Child4_Last_Name = $_POST['child4_last_name'];
$Street = $_POST['street'];
$City = $_POST['city'];
$StateProvince = $_POST['stateprovince'];
$PostalCode = $_POST['postalcode'];
$Phone = $_POST['phone'];
$Email = $_POST['email'];
$Confirm = $_POST['confirm'];
$Adults = $_POST['adults'];
$Children = $_POST['children'];
$RegistrationFee = $_POST['registrationfee'];
$Comments = $_POST['comments'];
$webMaster = '<[email protected]>';
$immigrant="";
foreach($_POST["immigrant"] as $option){
$immigrant .= $option;
}
$body = <<<EOD
Descendant_First_Name: $Descendant_First_Name
Descendant_Middle_Name: $Descendant_Middle_Name
Descendant_Surname: $Descendant_Surname
S_SO_First_Name: $S_SO_First_Name
S_SO_Middle_Name: $S_SO_Middle_Name
S_SO_Last_Name: $S_SO_Last_Name
Child1_First_Name: $Child1_First_Name
Child1_Middle_Name: $Child1_Middle_Name
Child1_Last_Name: $Child1_Last_Name
Child2_First_Name: $Child2_First_Name
Child2_Middle_Name: $Child2_Middle_Name
Child2_Last_Name: $Child2_Last_Name
Child3_First_Name: $Child3_First_Name
Child3_Middle_Name: $Child3_Middle_Name
Child3_Last_Name: $Child3_Last_Name
Child4_First_Name: $Child4_First_Name
Child4_Middle_Name: $Child4_Middle_Name
Child4_Last_Name: $Child4_Last_Name
Street: $Street
City: $City
StateProvince: $StateProvince
PostalCode: $PostalCode
Phone: $Phone
Email: $Email
Confirm: $Confirm
Descended From: $immigrant
Adults: $Adults
Children: $Children
RegistrationFee: $RegistrationFee
Comments: $Comments
EOD;
$headers = "From: $email\r\n";
$headers .= "Content-type: text/html\r\n";
/* if we got any errors echo out the error otherwise send the mail */
if($error != "") {
echo $error;
}else{
$success = mail($webMaster,$emailSubject,$body,$headers);
echo "Your Registration has been submitted successfully. We will contact you by email and confirm your Registration within 48 hours.";
}
}else{
/* If $_POST check is false give this message */
echo "Form Submission error."; <a href='javascript:history.back(1);'>Back</a>";
}
?> [/php]