Lately, while developing sites, I’ve started to deal with a lot of form submissions, and I’m finding that it takes extra steps to prevent people from accidentally submitting a form twice. Double-posting (hitting the Submit button more than once, or refreshing a page where data has been processed) can lead to all sorts of bad problems. Imagine if PayPal had no mechanism in place to prevent a double post. When you win an auction and pay John Q. $500 for the latest smartphone, you don’t want to be able to refresh the page or hit submit again and pay him an additional $500 bucks. Most of the time, your browsers will give you a warning, much like:

I find those alerts more annoying and confusing than helpful, so I’d like to get rid of them completely. I’ve got a couple of HTML/PHP examples that demonstrate a typical form submission and a modified one that doesn’t show any POSTDATA messages.
You’ll probably want to use some more programming to further prevent double-posts, and I’ve developed a PHP class that may be useful to you. Check out the Post Block class and example here.
Apply BOTH techniques for a post-blocking double-whammy…
Recent Comments