Forum Moderators: coopster

Message Too Old, No Replies

Preventing Multiple Form Submissions

         

cohoho

6:34 pm on Aug 17, 2006 (gmt 0)

10+ Year Member



In my javascript form validation function I prevent double-clicking users from submitting the same request multiple times, but retain full functionality for backing up and making another request. But what if javascript is disabled - what is the best approach for a server-side solution using PHP?

Cookies can be disabled so that's probably not the best approach. What about sessions? What are the pros and cons of using sessions for this? How about a time-based limiter? For either of these methods, can the user be identified somehow other than IP number? I would like to avoid compromising usability for browsers behind a proxy server.

All input appreciated.

jatar_k

6:57 pm on Aug 17, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you could assign a token/string in your form and retain that through the posting process and saving it somewhere. Then if the user with the same token/string tries to sub again you could check it and send them an error.

They could still go back to the first step and start again as they would receive a new token/string.