Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: How to avoid mulitple submission of form in html

by afoken (Parson)
on Sep 10, 2011 at 06:34 UTC ( #925215=note: print w/ replies, xml ) Need Help??


in reply to Re: How to avoid mulitple submission of form in html
in thread How to avoid mulitple submission of form in html

Create an onclick trigger on your button which includes some javascript [...]] Should do the trick.

Nope. Adding Javascript to the client will never solve a server side problem. Simply because Javascript is not always available on the client (LWP, WWW::Mechnanize, NoScript, filtering proxies, ...). And, quite obviously, it can be disabled on the client. In a WWW environment, you must not trust the client.

The server has to detect that the form was submitted several times. The usual approach is to give each form a unique ID (e.g. a UUID) in a hidden field or as part of the submit URL; and to make sure that each and every ID is accepted exactly once.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)


Comment on Re^2: How to avoid mulitple submission of form in html

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://925215]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (13)
As of 2014-07-14 12:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (259 votes), past polls