PDA

View Full Version : How to prevent double submit, on a web page??


newToCgi
10-10-2007, 05:39 PM
Hi All,

I am new to CGI. Our application is coded in C language.

Simple question. we have a web page, where you put in all the information and hit "submit" button and it takes to another page.

Now, we can use the "back" button on the browser to go back to the previous page. Once in the previous page, if I hit the Submit button again, I want an error message.
How to accomplish this task???

Right now....its executing the cgi program again, even after going back using the browser 'back' button feature.

Thanks,
CC :confused:

angst
10-10-2007, 09:02 PM
maybe after the first time the user runs the cgi script a cookie or session could be set, then if the user tried to hit it again, you can check for the cookie or session & notify the user.

eeijlar
10-11-2007, 04:31 PM
You might be able to use java script to disable the button once it's clicked.

angst
10-11-2007, 04:34 PM
thats not what he's asking for though, he's talking about after returning to the page not being able to re-submit.