hi! i was wondering how to use php for automatic redirection to a page on the website
basically, the visitors first fill out a form, and the form gets e-mailed to me and takes the visitors to a page saying “Thank you for filling out the form”.
This form e-mail thing is done using php … and i was wondering how to incorporate a redirection code in the following code so that afer submitting a form, the user goes to the page thats says “thank you …” and redirects the user back in 3 seconds to the a different page
<?PHP
$to = "BLABLA@gmail.com";
$subject = "Submit a FORM";
$headers = "From: Form Mailer";
$forward = 0;
$location = "";
$date = date ("l, F jS, Y");
$time = date ("h:i A");
$msg = "Below is the result of your feedback form. It was submitted on $date at $time.
";
if ($_SERVER['REQUEST_METHOD'] == "POST") {
foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "
";
}
}
else {
foreach ($_GET as $key => $value) {
$msg .= ucfirst ($key) ." : ". $value . "
";
}
}
mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header ("Location:$location");
}
else {
echo "Thank you for submitting your review.";
}
?>
THANX A LOT FOR HELPING!!