This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > Dreamweaver > March 2004 > Prevnting a User Going Back





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Prevnting a User Going Back
Keith

2004-03-30, 8:08 pm

This is for an Intranet application before I continue.

I have a fairly complex form that users will be filling in, which is spread
over several pages.

This is all ASP by the way.

I do not want a user on page 3 for instance to be able to click back and go
to page 2 - I want them to be forced to go back to page 1.

Is there a way to do this?

I know I can do a response.redirect, but can I be selective and
response.redirect if the previous page was form3 etc.?


Paul Anthony

2004-03-30, 8:11 pm

You can obtain the referrer using Request.ServerVariables("HTTP_REFERRER")

Paul.


"Keith" <@.> wrote in message news:c3ufof$36j$1@forums.macromedia.com...
> This is for an Intranet application before I continue.
>
> I have a fairly complex form that users will be filling in, which is

spread
> over several pages.
>
> This is all ASP by the way.
>
> I do not want a user on page 3 for instance to be able to click back and

go
> to page 2 - I want them to be forced to go back to page 1.
>
> Is there a way to do this?
>
> I know I can do a response.redirect, but can I be selective and
> response.redirect if the previous page was form3 etc.?
>
>



Bill

2004-03-30, 8:11 pm

Hey Paul,

This is a very usefull script that i use to stop people hitting the back
button and running scripts twice ect...

<%
Response.Buffer = True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"

If Len(Session("FirstTimeToPage")) > 0 then
'The user has come back to this page after having visited
'it... wipe out the session variable and redirect them back
'to the login page
Session("FirstTimeToPage") = ""
Response.Redirect "/Alerts/PageExpired.asp"
Response.End
End If
'If we reach here, the user can view the page, create the form
Session("FirstTimeToPage") = "1"
%>

Just rename the session for each form and put it at the top of each page...

Regards

Bill


"Paul Anthony" <paul@(NOSPAM)netramedia.com> wrote in message
news:c3v0jj$5b$1@forums.macromedia.com...
> You can obtain the referrer using Request.ServerVariables("HTTP_REFERRER")
>
> Paul.
>
>
> "Keith" <@.> wrote in message news:c3ufof$36j$1@forums.macromedia.com...
> spread
> go
>
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews