Skip to content Skip to sidebar Skip to footer

Let Jquery Know Which Was The Last Visited Php Page?

this is a little bit tricky. usually when someone clicks on a link that requires him to register, this person will be redirected to the registration page and then back to the last

Solution 1:

You can set cookies initially in php and then update/read them via js.

Solution 2:

You could assign the page to a session and do it that way.

$_SESSION["page_visited"] = "x.php";

Make sure to use session_start on the pages using sessions. Then just redirect to the relevant page.

header('Location: http://www.example.com/'$_SESSION["page_visited"]);

Solution 3:

I did a similar thing not two weeks ago, correct me if I'm wrong, but if you want the registration to direct to the page the user was on, after the user has been registered in the ajax just add:

window.location.href=window.location.href;

That way the after the registration is done, it just reloads where the member was with the environment of a logged in user. This method worked great for me.

Post a Comment for "Let Jquery Know Which Was The Last Visited Php Page?"