Tuesday, February 7, 2012

[PHP] Referred by Who?

Want to know where you viewers came from? Or which site referred you? PHP have a code for that!
$_SERVER['HTTP_REFERER']

Example:
$refer = $_SERVER['HTTP_REFERER'];
echo "You were referred by " . $refer;

Sample Output:
You were referred by http://entertainmentgames09.blogspot.com

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...