Home » HTML » HTML_QuickForm » Bug #1862
Ability to detect and prevent duplicate submits
Details
| Request #1862 | Ability to detect and prevent duplicate submits |
|---|---|
| Submitted | 2004-07-13 15:38 UTC |
| From | ricko at garagegames dot com |
| Status | Wont fix |
| Package | HTML_QuickForm |
| PHP Version | 4.3.7 |
| OS | ALL |
| Roadmaps | (Not assigned) |
Comments
[2004-07-13 15:38 UTC] ricko at garagegames dot com
Description:
------------
Requesting the ability for QuickForm to detect and handle end users pressing submit multiple times (or hackers forging duplicate submits).
Client Side: Add JavaScript to disable the Submit button (and possibly replace its text) once it has been pressed. This prevents end users from accidently pressing submit multiple times. This happens alot with dial-up surfers.
Server Side: This requres some sort of persistent store, using session variables should be fine. On successful validation store a unique value (either a hash of the form contents or a hidden field value) in the session. If a duplicate submit occurs the validate function can compare the session variable and detect the duplicate submission.
Server Side Action on Duplicate: We don't want to break existing code so it might suffice to simply add an API function isDuplicateSubmission() that can be used like this.
if ($form->validate())
{
if (!$form->isDuplicateSubmission())
$form->process('process_callback');
}
If this functionallity exists please excuse the submission and direct me to a URL.
Reproduce code:
---------------
n/a
Expected result:
----------------
n/a
Actual result:
--------------
n/a
[2005-09-08 16:31 UTC] cshaun at hotmail dot com
Don't really see why it would be so application specific? Surely it's simple enough just to check/prevent if it's a duplicate submission?