Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Prevent Users from Resubmitting a Form
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

mafifi
Junior Member

USA
308 Posts

Posted - 13 May 2001 :  18:15:39  Show Profile  Send mafifi an ICQ Message
I have a form where users submit information that is stored in an Access DB. After the user submits the information, they are redirected to a thank you page. If they click their browser's BACK button they will be able to go back to the form and resubmit, whick I'm trying to prevent. Is there a simple way to prevent this from happening? I remember seeing a code somewhere that makes the page expire as soon as the user submits the form.

Thanks,

Mo

mafifi
Junior Member

USA
308 Posts

Posted - 13 May 2001 :  18:41:15  Show Profile  Send mafifi an ICQ Message
I found this code at http://www.aspcode.net/
<% 
Response.Buffer = True
Response.Expires = -1
Response.AddHeader "Pragma", "no-cache"
Response.AddHeader "cache-control", "no-store"
%>


Let me know what your thoughts are?

Thanks,

Mo

Edited by - mafifi on 13 May 2001 18:43:03
Go to Top of Page

MorningZ
Junior Member

USA
169 Posts

Posted - 13 May 2001 :  21:45:51  Show Profile  Visit MorningZ's Homepage  Send MorningZ an AOL message
its not bullet proof

( we spent like a month at work trying to make sure that what you are looking to do doesnt happen, but different browswers, differents versions of browsers, etc etc, too much to think about )

what it entailed for us is that we went away from Autonumbering Primary Keys and many checks, but its way too complex a solution for most situations..

but how about this
on the Thank You page, set a session variable ( or a cookie ) that is like Session("formSubmitted") = 1

and before the insert in the page before, do a quick check for that, if it does NOT exist, then go ahead and do the insert, if it does exist, inform the user their info is alreayd captured



Edited by - MorningZ on 13 May 2001 21:46:46
Go to Top of Page

paco
Junior Member

Spain
187 Posts

Posted - 14 May 2001 :  03:07:56  Show Profile
The session option is probably the best but remember that if the user doesn't allow cookies Session won't work.

Go to Top of Page

HuwR
Forum Admin

United Kingdom
20595 Posts

Posted - 14 May 2001 :  04:05:50  Show Profile  Visit HuwR's Homepage
if you hunt around, there is also a mod which introduces a delay between posts, so a user can't post again for 60 seconds.

Go to Top of Page

mafifi
Junior Member

USA
308 Posts

Posted - 14 May 2001 :  20:30:37  Show Profile  Send mafifi an ICQ Message
I found these two articles.
http://www.4guysfromrolla.com/webtech/012600-1.shtml
http://www.4guysfromrolla.com/webtech/111500-1.shtml

Enjoy,



Mo
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.48 seconds. Powered By: Snitz Forums 2000 Version 3.4.07