In PHP you can check for a value in $_SERVER['HTTP_REFERER'], but it will not always be set depending on whether the browser or other client "chooses" to send it. (The same data probably shows up in your web server logs, too, since it comes from the web server in the first place.)