How do i find out what URL a user entered to find my site.
Posted: Mon Nov 07, 2005 3:44 pm
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss
A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
$_SERVER['HHTP_REFERER'];//get referring URL
$referring_url = $_SERVER['HTTP_REFERER']; //assign referring URL
//i believe if you change 'host' to 'path' you get the whole string
$parsed = (parse_url($referring_url)); //breaking this bad boy down
$uri = $parsed['host']; // calling the host from the referer URL
// echo "<BR>uri: " . $uri . ""; // testing purposesreserved.variables wrote:'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.