Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preventing user from going back

Status
Not open for further replies.

wanch78

Programmer
Nov 4, 2000
4
0
0
MY
Hi!! How can I prevent users from going back to see the previous page? This should only be applicable for certain pages. That is because I don't want them to resubmit a form once they have already submitted it. I will be grateful for any help. Thanks!
 
I think you can do it with a meta tag.

If you want to do server side checking, you can log their IP with the form, then match it against the last record sent, or if they were there before...

Code:
<CFQUERY NAME=&quot;PastForms&quot;>
   SELECT TOP 1 *
   FROM your_table
</CFQUERY>

<CFIF #pastforms.ip# eq #cgi.remote_addr#>
   <P>Sorry, you can only submit the form once!
</CFELSE>
   <CFQUERY NAME=&quot;Insert&quot;>
     INSERT INTO your_table ('ip')
     VALUES ('#cgi.remote_addr#')
   </CFQUERY>
   <P>Thanks!
</CFIF>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top