Jump to content

Return Point (?)


henryhenry
 Share

Recommended Posts

For example, a user needs to register before accessing a part of the site. The registration takes the user to another page. After finishing the user is left on the homepage and not where s/he clicked 'register'.I can think of a few possible solutions to allow the user to return automatically to the original page. Are there any standard methods out there that are tried an tested? I was thinking of storing a session variable ... something like:$_SESSION['return_point']= $_SERVER['PHP_SELF'];When it's set a return point is available so that after the registration script, it can check if it's set and send the user there.I could use the database but that would seem a bit exhaustive.Anyone have a favourite method?Thanks!!! :)Henry

Link to comment
Share on other sites

I typically look at the referrer. If someone is on page5.php and clicks on your register button to load register.php, I would check on the register.php page what the referrer was and store that either in the URL (register.php?page=page5.php) or in a Session. Then, when the registration is complete, redirect the user to that page.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...