Love the form tutorial – Thanx!
Q: how can i send a confirmation email with a generic text + form output to the user who is sending the form? Here is the code:
<?php
if(isset($_POST[‘submit’])) {
$to = "msn@msn.com";
$subject = "Subject!";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$phone_field = $_POST['phone'];
$dropdown = $_POST['drop_down'];
$city_field = $_POST['city'];
$terms_field = $_POST['terms'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value
";
}
} else {
$body = "Full Name: $name_field
$check_msg E-Mail: $email_field
$check_msg Daytime Phone: $phone_field
$check_msg State: $dropdown
$check_msg City: $city_field
$check_msg Terms & Conditions: $terms_field
";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo “blarg!”;
}
?>
Thanx!