Re: How to skip browser's Warning?
| From: | Eric Butera | Date: | Wed, 13 Sep 2006 17:17:57 +0000 |
| Subject: | Re: How to skip browser's Warning? | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241737@lists.php.net to get a copy of this message | ||
On 9/13/06, afan@afan.net <afan@afan.net> wrote:
Wouldn't this actually bring me back to empty form? On 9/13/06, afan@afan.net <afan@afan.net> wrote:implementation. An easy way to handle this is to stick the sanitized post values into the session and go wherever you need to.scriptsorry, 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:gettingHi, Could somebody explain to me what to do to skip this message I'mproducts,after I search for some products on my page, got the list ofofselected a detailed view of the product and click on the Back buttonfromthe browser to see again list of found products (result page): "The Page you are trying to view contains POSTDATA that has expiredas acache. If you resend the data, any action the form carried out suchclicksearch or online purchase) will be repeated. To resend the data,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 yourprocesses the POST data you can avoid this.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') {Sure..//do processing here if ( success ) { 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! Yes, but I was leaving up to you to fill in the blanks for your