Re: Dealing with multiple form submissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On Aug 24, 2011, at 11:52, John Black <spam@xxxxxxxxxxxxxxxxxxxxxxxx> 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.
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux