/    Sign up×
Community /Pin to ProfileBookmark

Back buton – several pages back – in HTML ?

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

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@Declan1991Dec 09.2007 — Log it as a session variable.
Copy linkTweet thisAlerts:
@attila001122authorDec 09.2007 — Yes....

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

Is there a simple script for it?

Thanks !
Copy linkTweet thisAlerts:
@nap0leonDec 10.2007 — 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):
[CODE]
<%
session("PageUserWasOnBeforeRegistering") = Request.ServerVariables("HTTP_REFERRER")
%>
[/CODE]


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

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

Success!

Help @attila001122 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...