Forums

PHP

This topic is locked

Form redirect after submit

Posted 01 Sep 2004 09:28:17
1
has voted
01 Sep 2004 09:28:17 Mikhail R. posted:
Could someone please tell me what the code is (and where it goes) to redirect to a specific page (on submission of a form) instead of bringing up echo 'thank you.....' as in the following code.


<?
$name=$_POST['name'];
$email=$_POST['email'];
$address=$_POST['address'];
$city_state_zip=$_POST['city_state_zip'];
$phone=$_POST['phone'];
$notes=$_POST['notes'];
$to="info@email.com";
$message="$name just filled in Reservations form. They are from:\n$address \n$city_state_zip \nPhone number: $phone \nMessage:\n$notes\n\nTheir e-mail address was: $email";
if(mail($to,"Comments From Your Site",$message,"From: $email\n")) {
echo "Thank you for your information, \nwe will review it an contact you as soon as possible.";
} else {
echo "There was a problem sending the mail. Please check that you filled in the form correctly.";
}
?>






--------------------------------------
If you don't ask the answer is always no.

Replies

Replied 02 Sep 2004 06:14:56
02 Sep 2004 06:14:56 Mikhail R. replied:
Hello! Anyone ever reads this forum?

--------------------------------------
If you don't ask the answer is always no.
Replied 31 Jan 2008 01:59:45
31 Jan 2008 01:59:45 Stefan Strecker replied:
I found an easy and perfect solution
Just use this echo line:

echo "&lt;meta http-equiv='Refresh' content='0; URL=www.whateverurl.com'&gt;";

You can change the 0 to any other number. This number equals the seconds before refresh starts.
SEROS your way!
Bye,
Stefan
Replied 01 Feb 2008 10:14:17
01 Feb 2008 10:14:17 Alan C replied:
HI
Have a look at forms to go, it's a small shareware application that does form validation and can redirect as required - makes life a lot easier. There's a mac version too <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>

Reply to this topic