Re: Preventing repost
| From: | mlemos at zip dot net | Date: | Thu, 04 Jan 2001 16:21:09 +0000 |
| Subject: | Re: Preventing repost | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-5597@lists.php.net to get a copy of this message | ||
Hello,
Dusten wrote:
>
> Hello
> I need to find a way to prevent a user from hitting 'back' on their browser
> and reposting the form data.
You may want to try this PHP form generation class that lets you specify
a message in a Javascript dialog that
asks the user if he really wants to submit the form again. Usually
nervous users submit the forms more than once
because they don't want to wait. This class would help in that aspect.
http://phpclasses.UpperDesign.com/browse.html/package/1
This would not prevent the user to submit the form more than once
deliberately. If you really want to prevent that what is usually done is
to have a create a random key that is stored in a database and is passed
in the form as an hidden field. Once the form is submitted the key is
cleared from the database. Next time the form is submitted you may
verify that the key does not exist and not process the form.
Manuel Lemos