I created a php contact form at http://www.rogerworthington.com . It works fine, however the client also wants the form to email to the person who filled it out. I tried a couple things that didn’t work. Any help would be appreciated. Here is the php code:
<?php
if(isset($_POST[‘Submit’])) {
$to = “jason@jasonmilburn.com”;
$subject = “MESOTHELIOMA Request For More Information”;
foreach($_POST[‘check’] as $value) {
$check_msg .= "Checked: $value
";
}
$type = $_POST[‘type’];
$ifother = $_POST[‘ifother’];
$name_field = $_POST[‘name’];
$phone = $_POST[‘phone’];
$confirmphone = $_POST[‘phone2’];
$email_field = $_POST[‘email’];
$confirmemail = $_POST[‘email2’];
$address_field = $_POST[‘address’];
$city_field = $_POST[‘city’];
$state_field = $_POST[‘state’];
$zip_field = $_POST[‘zip’];
$time = $_POST[‘time’];
$claim = $_POST[‘claim’];
$exposed = $_POST[‘exposed’];
$body = "Diagnosed with Mesothelioma? $check_msg
Type of Mesothelioma: $type
If Other: $ifother
Name: $name_field
Phone: $phone
COnfirm Phone: $confirmphone
E-Mail: $email_field
Confirm E-Mail: $confirmemail
Address: $address_field
City: $city_field
State: $state_field
Zip Code: $zip_field
Best Time To Call: $time
Claim is For: $claim
I was exposed to Asbestos: $exposed
";
echo “Thank you for contacting us.”;
mail($to, $subject, $body);
} else {
echo “Error!”;
}
?>