Jump to content

Return Point (?)


henryhenry

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...