|
craigj1303 -> directing to a "thanks" page with PHP (5/1/2008 11:20:05)
|
Hi I know nothing about PHP and I am trying to come up with a basic contact form for my website. The form is no problem and I have cut and pasted some PHP which I have tried and tested OK for sending me mail. The only thing I want to change is what happens after the form is submitted. I want to direct the client to a "thanks for your comments" page where they can then carry on navigating their way around the site. At the moment they just get a message saying "data has been submitted" and would have to use the back button to get back. Can anyone advise me how to direct them to a different page? Below is the .php file I am using: <?php if(isset($_POST['submit'])) { $to = "xxxxxxxxxx@hotmail.com"; $subject = "Matchday Programmes"; $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); } else { echo "blarg!"; } ?> Thanks in advance Craig
|
|
|
|