Re: Avoiding user refresh of pages with forms
| From: | Rory McKinley | Date: | Wed, 03 May 2006 18:32:38 +0000 |
| Subject: | Re: Avoiding user refresh of pages with forms | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-235398@lists.php.net to get a copy of this message | ||
Brad Bonkoski wrote:
Is there a way to key off of the data inserted? Like some unique value or set of values that you can do a quick lookup before you insert/update/delete again... Or you could venture into an AJAX style of submission keyed off of a button click then a refresh to a 'report' page, in which case no POST variables are actually passed to the report page, so refreshing it will just present the same data... -Brad Jeff wrote:To follow on from what Brad said - would it be possible to generate a "key" as a hidden value when the form is created. The first time the user submits the server checks if that unique code has ever been used within the current session - if not, adds value. If so, ignores. As a "unique" key you could use say timestamp plus random number. HTH RoryIs there a way to prevent a re-posting of the form data when a user pushes the "refresh" button on the browser? <snip>