Re: Dealing with multiple form submissions
| From: | Mike Mackintosh | Date: | Wed, 24 Aug 2011 19:38:14 +0000 |
| Subject: | Re: Dealing with multiple form submissions | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-314598@lists.php.net to get a copy of this message | ||
On Aug 24, 2011, at 11:52, John Black <spam@network-technologies.org> wrote:
> On 08/24/2011 03:04 AM, Jason Pruim wrote:
>> Wondering what everyone does to prevent multiple form submissions?
>> My form is simply getting emailed to my email, and it redirects to a success page when
>> submitted...
>> Would it be as simple as doing something with the cache control? Basically I'm trying
>> to avoid someone submitting a form... Then hitting back, and submitting again, then hitting back....
>> I think you get the idea...
>> What do you all do?
>> Jason Pruim
>
>
> Hi,
> I am using $_SESSION for this. Set a value on the initial page, a timestamp is a good choice,
> then validate the value on the receiving script and clear the value.
>
> I like to use a timestamp because it will allow you to deny a comment which took too long to
> submit.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
I've always tended to stay away from session for that, as when the browser closes/restarts, the
page is accessible again.