Computing.Net > Forums > Web Development > Redirection after Submit PHP Form

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Redirection after Submit PHP Form

Reply to Message Icon

Name: cakonopka
Date: March 21, 2008 at 10:57:50 Pacific
OS: Windows Vista Ultima
CPU/Ram: AMD X2 5200+ / 4GB D
Product: Home Build
Comment:

Hi Guys

I want to get my site to redirect me back to the homepage once my basic PHP form submission has been sent to my e-mail address. Do i need to add code into the HTML or the PHP file?

Many Thanks

Chris

AMD 5200 X2 64bit
Asus A8N-SLI MB
4GBDDR 800mhz 4X 1GB
MSI 8800GTX Card
Creative X-FI Fatality Professional Gamer.
Compro E750 Digital TV Card
200GB X2, 250GB X2, 300GB SATA Hard Dri



Sponsored Link
Ads by Google

Response Number 1
Name: Laler
Date: March 21, 2008 at 11:28:13 Pacific
Reply:

If in the PHP file, it needs to be before anything outputted to the screen (eg: before any "echo" and/or before anything written outside the <?php ?> tag).

This is the code:

header ('Location: hxxp://yoursite/yourpage');
exit ();

*change xx to tt


---
Fubar


0

Response Number 2
Name: Harish Kumar
Date: April 2, 2008 at 03:50:14 Pacific
Reply:

make sure that before you use header ('Location: hxxp://yoursite/yourpage');
exit ();

you are not printing something either by php statement nor by html or any blankline..
else you will get an error sayong headers already sent..


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: Redirection after Submit PHP Form

PHP Form www.computing.net/answers/webdevel/php-form/2146.html

php form www.computing.net/answers/webdevel/php-form/2824.html

php form www.computing.net/answers/webdevel/php-form/762.html