Re: How to handle the POST data
| From: | Chris Shiflett | Date: | Mon, 10 Nov 2003 19:11:23 +0000 |
| Subject: | Re: How to handle the POST data | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-169071@lists.php.net to get a copy of this message | ||
--- Koala Yeung <perlkoala@hotmail.com> wrote:
> The problem is: right after a submit process, POSTDATA still stored in
> the user's browser. When one submit a thread, read the index table of
> forum.php, and press "Reflash", the browser will give a message like:
> "The page you are browsing contains POSTDATA. If you Re-submit the
> information, the webpage will do the action again..."
>
> What can I do?
There are many solutions. My favorite:
1. Have an intermediate page that does whatever processing you need, then
redirect to a different URL for display using:
header('Location: http://example.org/path/to/script.php');
In this case, the series of events would look something like this:
writeforum.php -> add_post.php -> forum.php
The add_post.php script will not appear in the browser's history
mechanism, and the user will not see a warning whenever refreshing the
forum.php page.
Hope that helps.
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp