PDA

View Full Version : HELP! Need redirect to PREVIOUS page



ShadowIce
Sep 23rd, 2009, 12:41 AM
Hi. How can I redirect using a meta refresh, only instead of redirecting to the index page, using "../", it redirects to the page that the client was on BEFORE they came to my website?

ANY help is GREATLY appreciated! :)

jolly_nikki
Sep 23rd, 2009, 01:10 AM
You can use history.back() or history.go(-1);

Keleth
Sep 23rd, 2009, 01:18 AM
Its either Javascript or a server-side code for this one.

history.back() or with PHP you can grab the referring page and just go back to it.

ShadowIce
Sep 23rd, 2009, 01:51 AM
Ok. so how can i use php to do this?

can u show me a small example?

ShadowIce
Sep 23rd, 2009, 02:33 AM
Let me rephase that before we have issues here.

can u show me an example of how i can do this w/ php for ALL browsers?

ShadowIce
Sep 23rd, 2009, 04:11 PM
Can someone please help?

Keleth
Sep 23rd, 2009, 07:26 PM
With PHP, there's no built in feature. What I do is I have two session variables that are constantly updated in my initialization code


$_SESSION['lastURL'] = $_SESSION['currentURL'];
$_SESSION['currentURL'] = $_SERVER['REQUEST_URI'];