I’m using the code from a great tutorial I got here at Kirupa and am trying change the “echo” so that when the user has completed the form, rather than seeing “Data has been submitted to…” they are redirected back to the home page? This is my first time with php…
<?php
if(isset($_POST['submit'])) {
$to = "matt@zerofivezero.net";
$subject = "Comment";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$option = $_POST['radio'];
$dropdown = $_POST['drop_down'];
foreach($_POST['check'] as $value) {
$check_msg .= "Checked: $value
";
}
$body = "From: $name_field
E-Mail: $email_field
$check_msg Option: $option
Drop-Down: $dropdown
Message:
$message
";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "rats!";
}
?>