php redirection or links
Posted: Sun Sep 30, 2007 9:21 am
Hello. I have created a new site, which has only had the one page uploaded live for a small test - http://www.discountgardencentre.co.uk/contact. The forum passes the data to mailer.php - which then echos "Thank you for your comments to xyz@abc.co.uk" on screen. That is the only output the code gives. It does work, as the emails are sent to our inbox. But, the problem is, it takes the user to a dead page, with no redirection back to the main site or even a link to get there. This is the code for the php file, I would like the file to redirect after 5 seconds, or display a link to say something to the effect of "Click here to return to http://www.discountgardencentre.co.ukwww.discountgardencentre.co.uk.
Thank you for your help!
Code: Select all
<?php
if(!$url) { $url = 'http://www.discountgardencentre.co.uk'; } ?>
if(isset($_POST['submit'])) {
$to = "sales@cupargardencentre.co.uk";
$subject = "OnlineGardenCentre.uk.com Query";
$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 "Thank you for your comments to $to!";
mail($to, $subject, $body);
<?php echo($url); ?>
} else {
echo "Sorry, the e-mail function failed. Please try again or e-mail us directly at sales@cupargardencentre.co.uk";
}
?>Thank you for your help!