nitelava
March 14th, 2007, 11:43 PM
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\n";
}
} else {
$body = "Full Name: $name_field\n $check_msg E-Mail: $email_field\n $check_msg Daytime Phone: $phone_field\n $check_msg State: $dropdown\n $check_msg City: $city_field\n $check_msg Terms & Conditions: $terms_field\n";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
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\n";
}
} else {
$body = "Full Name: $name_field\n $check_msg E-Mail: $email_field\n $check_msg Daytime Phone: $phone_field\n $check_msg State: $dropdown\n $check_msg City: $city_field\n $check_msg Terms & Conditions: $terms_field\n";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "blarg!";
}
?>
Thanx!