How can you get the referring URL in PHP?

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
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

How can you get the referring URL in PHP?

Post by MattSharp »

Just wondering how you do this in PHP? Thanks.....
Craig
Forum Commoner
Posts: 37
Joined: Thu Apr 18, 2002 3:13 pm

Post by Craig »

$HTTP_REFERER
angelorigo
Forum Newbie
Posts: 3
Joined: Thu Apr 25, 2002 2:05 pm
Location: porto alegre

Post by angelorigo »

$HTTP_REFERER ?!?
Zmodem
Forum Commoner
Posts: 84
Joined: Thu Apr 18, 2002 3:59 pm

Post by Zmodem »

Use this to find the referer

Code: Select all

$HTTP_SERVER_VARS&#1111;'HTTP_REFERER']  // PHP <= 4.06
$_SERVER&#1111;'HTTP_REFERER']           // PHP >= 4.1.0
HTTP_SERVER_VARS and _SERVER are the same thing. They are just an array that holds a wide variety of data about the users browser and other useful things. See http://www.php.net/manual/en/reserved.variables.php for more details

--cheers
MattSharp
Forum Commoner
Posts: 62
Joined: Wed Apr 24, 2002 2:25 pm

Post by MattSharp »

Yea I should have thought of that, thanks d00d......
Post Reply