in reply to CGI Cookie
I've got a form-->CGI scenario; let there be no re-entry of the same data.
There are a number of things to consider.
* What defines an invalid resubmission? Never twice by the same user? Never twice by the same machine/browser? (cookies come into play here) Never twice within 2 seconds /2 minutes / 2 hours? Perhaps one of the submitted fields can't be a duplicate?
Any of the above ideas are the basis for a code-based solution for distinguishing valid submisssions.
* If you do end up having the CGI set a cookie to indicate that this browser has submitted this form you'll run into a number of limitations. Cookies can be deleted due to space considerations. Your cookie won't be set prior to a user being able to click the submit button again (and again, and again).
One idea to help prevent users from clicking a submit button multiple times is to have a javascript function hide the submit button and message the user (Processing...) after the first submission. Your CGI would continue to work as needed.
A working example to put in your HTML:
you can use this Javascript and this code snippet below, using the onsubmit attribute of the form tag.
<script language="JavaScript"> <!-- function submitForm() { document.getElementById('submit').value = "Please Wait..."; document.getElementById('submit').disabled = "disabled"; return true; } //--> </script> <form method="post" action="login.asp" onsubmit="submitForm();"> <input type="text" id="price" name="price"><br> ... <input id="submit" name="submit" type="submit" value="Send data"> </form>
Monks:
Please don't flame me for not addressing this in perl. I'm not aware of any client-side perl and this particular problem needs to be addressed on the client-side.
Cheers
-------------------------------------
Nothing is too wonderful to be true
-- Michael Faraday
|
|---|