PHP Form

Hi, I have used this form several times on this website but now it isn’t working. I am not sure what is going on. I am new to php so any help will be appreciated greatly. The form is:

and it connects to this php form which the code is below. I am getting the confirmation email that it was sent to my email but when you press submit it says it encountered a problem and it wasn’t sent and the actual form information is not being received. The php code is below:

<?php $to = $_REQUEST['sendto'] ; $name = $_REQUEST['Childs_Name'] ; $dateofbirth = $_REQUEST['Date_of_Birth'] ; $grade = $_REQUEST['Grade_Level'] ; $firsttime = $_REQUEST['FirstTime'] ; $tshirt = $_REQUEST['T-Shirt'] ; $churchname = $_REQUEST['churchname'] ; $partentsname = $_REQUEST['Parents_Name'] ; $address = $_REQUEST['Street_Address'] ; $city = $_REQUEST['City'] ; $state = $_REQUEST['State'] ; $zipcode = $_REQUEST['Zipcode'] ; $daytimephone = $_REQUEST['Daytime_Phone'] ; $cellphone = $_REQUEST['Cell_Phone'] ; $from = $_REQUEST['Email'] ; $insurance = $_REQUEST['insurance'] ; $insurance2 = $_REQUEST['insurancenumber'] ; $emergencycontact = $_REQUEST['EmergencyContactName'] ; $emergencycontactphone = $_REQUEST['EmergencyContactPhone'] ; $emergencycontactrelationship = $_REQUEST['EmergencyContactRelationship'] ; $allergies = $_REQUEST['allergies'] ; $specialneeds = $_REQUEST['SpecialNeeds'] ; $headers = "From: $from"; $subject = "SonSurf Beach Bash: Registration Form"; $fields = array(); $fields{"Childs_Name"} = "\n\nChild's Name"; $fields{"Date_of_Birth"} = "\n\nDate of Birth"; $fields{"Grade_Level"} = "\n\nCurrent Grade Level"; $fields{"FirstTime"} = "\n\nIs this your child's first time attending camp at The Baptist Church of West Chester?"; $fields{"T-Shirt"} = "\n\nT-Shirt"; $fields{"churchname"} = "\n\nDoes your child/family regularly attend church? If yes, where? Name of church"; $fields{"Parents_Name"} = "\n\nParent's Name"; $fields{"Street_Address"} = "\n\nStreet Address"; $fields{"City"} = "\n\nCity"; $fields{"State"} = "\n\nState"; $fields{"Zipcode"} = "\n\nZip Code"; $fields{"Daytime_Phone"} = "\n\nDaytime Phone"; $fields{"Cell_Phone"} = "\n\nCell Phone"; $fields{"Email"} = "\n\nEmail"; $fields{"insurance"} = "\n\nInsurance Company Name"; $fields{"insurancenumber"} = "\n\nInsurance Group #"; $fields{"EmergencyContactName"} = "\n\nEmergency Contact Name"; $fields{"EmergencyContactPhone"} = "\n\nEmergency Contact Phone"; $fields{"EmergencyContactRelationship"} = "\n\nRelationship to child"; $fields{"allergies"} = "\n\nDoes your child have any allergies to food or medication? If yes, please list"; $fields{"SpecialNeeds"} = "\n\nDoes your child have any special needs we need to be aware of, such as an IEP, social issues, medical needs, etc.? If yes, please list\n\n"; $body = "SonSurf Beach Bash: Registration Form:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: [email protected]"; $subject2 = "Thank you for submitting your registration."; $autoreply = "Your SonSurf Beach Bash Registration has been received. Please contact us at 610.696.7466 if you have any additional questions. Sincerely, Dena Colson"; if($from == '') {print "You have not entered an email, please go back and try again";} else { $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) {header("Location:");} else {print "We encountered an error sending your mail, please notify Dena Colson at [email protected]";} } ?>

Thanks for any help anyone can give!

Sponsor our Newsletter | Privacy Policy | Terms of Service