Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to prevent double submit, on a web page??

    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

  • #2
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    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.

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    61
    Thanks
    11
    Thanked 0 Times in 0 Posts
    You might be able to use java script to disable the button once it's clicked.

  • #4
    Senior Coder angst's Avatar
    Join Date
    Apr 2004
    Location
    Toronto, Ontario
    Posts
    2,114
    Thanks
    15
    Thanked 122 Times in 122 Posts
    thats not what he's asking for though, he's talking about after returning to the page not being able to re-submit.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •