viewres previous page

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
marker5a
Forum Commoner
Posts: 29
Joined: Wed May 19, 2004 9:18 pm

viewres previous page

Post by marker5a »

Ok
I am writing a script, and I was wondering if there was a way to get the viewers previous page. For instance, lets say I was at google.com, and decided to go to this certain page, I would want the script to echo the http://www.google.com. Anyone know how?

Chris
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

$_SERVER['HTTP_REFERER']

however, do not bank on the variable existing.. as a lot of browsers, firewalls, proxies, and maybe even ISPs are starting to not send that header.
marker5a
Forum Commoner
Posts: 29
Joined: Wed May 19, 2004 9:18 pm

Post by marker5a »

I tried that and I kept getting the url of the script page. Anyways, I think I found another way to do this. Thanks though

Chris
Post Reply