You want to prevent visitors to your site from submitting a form more than once.
This code goes in the <head> section of your web page code:
Like elevator call buttons and watched pots on stovetops, web forms do not respond more quickly when given extra attention. When connecting to a credit card gateway (or to any other server over a slow Internet connection), web forms often take several seconds to return a result to the browser. Impatient web surfers (i.e., all of them) have the habit of clicking the submit button again and again in hopes of speeding up the process.
But unlike other everyday thumb-twiddlers, multiple clicks on a web site form can create big headaches for you and your visitors. Often, the extra clicks lead to additional unwanted orders, and you'll be the one left to sort out the details of refunding the money your visitors did not intend to spend.