in reply to
Avoiding a second click
If you can provide some sort of unique "transaction identifier" number that the server can use to check for duplicate submissions, you might be able to catch these.
In your CGI handler, for example, you would look to see if that transaction identifier had been submitted before, and if it had, you could either generate an error, or merely display the result of that prior transaction.
The problem with the second approach is that the user might have hit the emergency "Stop" button, changed something, and submitted again. In that case their change will be silently ignored, and that's not good.