So I have used the PHP contact form that could be found on kirupa.com.
I was wondering how I can modify this script so that once a person clicks on the “submit” button, that the page will redirect to a “thankyou.html” page to confirm that the message has been sent, rather than the “Data has been submitted to” message … any ideas? do i replace the echo message with a URL?
i’m a total n00b at PHP.
<?php
if(isset($_POST[‘submit’])) {
$to = "stefan@mstrpln.com";
$subject = "from MSTRPLN website form";
$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 “blarg!”;
}
?>