identifying the URL the user comes from

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
lordzoster
Forum Newbie
Posts: 7
Joined: Mon May 27, 2002 3:29 am

identifying the URL the user comes from

Post by lordzoster »

Hallo
i'd like to identify the site where the user cliccked the link to my page, eg.:
in a page of http://www.exturl.com there is a link to http://www.myurl.com
the user click the link
he arrives to http://www.myurl.com
a script in the page recognize where he comes from

i prefere not to use:
-cookies
-send methods in the external link

is it possible?

TIA
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Excerpt from Server variables: $_SERVER
'HTTP_REFERER'
The address of the page (if any) which referred the user agent to the current page. This is set by the user agent. Not all user agents will set this, and some provide the ability to modify HTTP_REFERER as a feature. In short, it cannot really be trusted.
User avatar
fatal
Forum Contributor
Posts: 118
Joined: Sat Apr 20, 2002 10:47 am
Location: East Coast

Post by fatal »

If they have an older version of PHP, $HTTP_REFFER will work the same.
Post Reply