View Full Version : HELP! Need redirect to PREVIOUS page

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! :)

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

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.

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

can u show me a small example?

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?

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

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'];