Page 1 of 1

How can I tell the url a visitor is coming from?

Posted: Fri Aug 29, 2008 4:57 pm
by sirkoolaid
How can I tell the url a visitor is coming from with PHP?

Re: How can I tell the url a visitor is coming from?

Posted: Fri Aug 29, 2008 11:12 pm
by Ziq

Code: Select all

<?
echo $_SERVER['HTTP_REFERER'];
?>
'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.
$_SERVER PHP manual