Click to See Complete Forum and Search --> : Back buton - several pages back - in HTML ?


attila001122
12-09-2007, 09:04 AM
Hello,

I dont know if someone had the same problems, but it seem to me that it is quite common.

For a service I would offer my visitors to log in or register...
Then after registering or logging in I would like to direct them back to the page where they had been diverted from.
And the number of steps and the page are not always the same.

Is there a way to "remember" the page name when click on register or login and at the end of the reg/log process go back there?

Thanks


Attila

Declan1991
12-09-2007, 09:29 AM
Log it as a session variable.

attila001122
12-09-2007, 10:36 AM
Yes....

I guess I need a PHP for that, but I do not have the knowledge...

Is there a simple script for it?

Thanks !

nap0leon
12-09-2007, 08:12 PM
On page one of your registration process add a line of code that captures the HTTP_REFFERER variable. You can then reference that URL in an href or a redirect.

Presuming Classic ASP (I've never touched PHP):

<%
session("PageUserWasOnBeforeRegistering") = Request.ServerVariables("HTTP_REFERRER")
%>


You can now use that variable on a link the user clicks on to return from whence they came...


<a href="<%=session("PageUserWasOnBeforeRegistering")%>" alt="Return to Whatever">Return</a>