php redirection or links

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Locked
grantg
Forum Newbie
Posts: 2
Joined: Sun Sep 30, 2007 9:13 am

php redirection or links

Post by grantg »

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.html 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.

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!
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Double Posting

Post by s.dot »

Locked.
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:3. Do not make multiple, identical posts. This is viewed as spam and will be deleted.
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Locked