Author |
Topic  |
|
mafifi
Junior Member
 
USA
308 Posts |
Posted - 13 May 2001 : 18:15:39
|
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
|
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 |
 |
|
MorningZ
Junior Member
 
USA
169 Posts |
Posted - 13 May 2001 : 21:45:51
|
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 |
 |
|
paco
Junior Member
 
Spain
187 Posts |
Posted - 14 May 2001 : 03:07:56
|
The session option is probably the best but remember that if the user doesn't allow cookies Session won't work.
|
 |
|
HuwR
Forum Admin
    
United Kingdom
20595 Posts |
Posted - 14 May 2001 : 04:05:50
|
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.
|
 |
|
mafifi
Junior Member
 
USA
308 Posts |
|
|
Topic  |
|