Page 1 of 1

How do i find out what URL a user entered to find my site.

Posted: Mon Nov 07, 2005 3:44 pm
by phillcahill
sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss

Posted: Mon Nov 07, 2005 3:49 pm
by foobar
You can try getenv('HTTP_REFERER'). I'm not sure if this can be accomplished using mod rewrite, but it would certainly be interesting.

Posted: Mon Nov 07, 2005 4:50 pm
by vincenzobar
heres a snippet i wrote to get referer info

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 purposes
good luck

Posted: Mon Nov 07, 2005 6:22 pm
by John Cartwright
reserved.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.

Posted: Mon Nov 07, 2005 7:43 pm
by feyd
it all depends on how these domains "point" to your actual domain. If they redirect to the main domain, asside from using a URL parameter to tell your main server where they are coming from, referrer is the only way to really know... If you remain on the other domain, but are accessing the main domain (rewriting/virtual host) then you can access what the server is through $_SERVER['HTTP_HOST']