Re: How to skip browser's Warning?
| From: | Eric Butera | Date: | Wed, 13 Sep 2006 16:59:46 +0000 |
| Subject: | Re: How to skip browser's Warning? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241735@lists.php.net to get a copy of this message | ||
On 9/13/06, afan@afan.net <afan@afan.net> wrote:
sorry, but didn't get this one. could you please elaborate it a little bi to me? thanks. On 9/13/06, afan@afan.net <afan@afan.net> wrote:Say you have form.php. This page will post to process.php. (Just an example. Having form.php post to itself is fine too and how I always do my forms since on error I redisplay them with filled values) Inside process.php you might have something like <?php if (strtolower($_SERVER['REQUEST_METHOD']) == 'post') { //do processing here if ( success ) {gettingHi, Could somebody explain to me what to do to skip this message I'mfromafter I search for some products on my page, got the list of products, selected a detailed view of the product and click on the Back button of the browser to see again list of found products (result page): "The Page you are trying to view contains POSTDATA that has expiredacache. If you resend the data, any action the form carried out such asprocesses the POST data you can avoid this. Sure..search or online purchase) will be repeated. To resend the data, click OK. Otherwise, click Cancel." Thanks for any help. -afan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php If you add a header redirect [header('Location:');] after your script
header('Location: http://example.com/thanks.php');
} else {
header('Location: http://example.com/form.php');
} // if
} // if
session_write_close(); // if you're using sessions
exit();
?>
Now when your form posts to process, your script will either go back to the
form.php on error, or thanks.php on success. Because process.php issues a
redirect, this tells the browser to ignore process.php in the history it
saves. If a user clicks the back button it will go to form.php because
process.php returned a 403 header and was "ignored" for lack of a better
word.
Hope that helps!