Im making the contact form side of my site,
When clicking submit, it loads mailer.php which displays:
echo "Data has been submitted to $to!";
However... i wish it to redirect back onto my website after say 5 seconds.
Is this possible with php?
Ive tried adding a sleep into it but it doesnt load the mailer.php it just waits.
I added it like so:
<?php
if(isset($_POST['submit'])) {
$to = "craiglovelock54@hotmail.co.uk";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
sleep(10);//seconds to wait..
header("Location:http://www.vinylpenguin.co.uk/page.php");
} else {
echo "blarg!";
}
?>
I expected it to load the page then run the sleep part but it doesnt.
Any help?
This post has been edited by Lovelock: 04 January 2012 - 12:10 PM
Help

















