# PHP Form

**URL:** <https://www.phphelp.com/t/php-form/12997>\
**Category:** General PHP Help\
**Created:** [March 30, 2011, 11:28pm UTC](https://www.phphelp.com/t/php-form/12997 "2011-03-30T23:28:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bcwc](https://www.phphelp.com/letter_avatar_proxy/v4/letter/b/ee59a6/32.png) [@bcwc](https://www.phphelp.com/u/bcwc)\
**Post date:** [March 30, 2011, 11:28pm UTC](https://www.phphelp.com/t/php-form/12997/1 "2011-03-30T23:28:46Z")

</div>

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: [http://www.bcwc.org/happenings/sonsurf.html](http://www.bcwc.org/happenings/sonsurf.html)

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: vbs@bcwc.org"; $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: http://www.bcwc.org/happenings/thanks.html");} else {print "We encountered an error sending your mail, please notify Dena Colson at vbs@bcwc.org";} } ?\> 

Thanks for any help anyone can give!  
Betsy
