Skip to content

Instantly share code, notes, and snippets.

@SErr0r
Created November 13, 2015 20:48
Show Gist options
  • Save SErr0r/cd39198d2f0ff6166526 to your computer and use it in GitHub Desktop.
Save SErr0r/cd39198d2f0ff6166526 to your computer and use it in GitHub Desktop.
Show user information (IP address, Browser (User Agent), Referrer)
<?php
$ip = $_SERVER['REMOTE_ADDR'];
$browser = $_SERVER['HTTP_USER_AGENT'];
$referrer = $_SERVER['HTTP_REFERER'];
if ($referred == "") {
$referrer = "This page was accessed directly";
}
echo "<b>Visitor IP address:</b><br/>" . $ip . "<br/>";
echo "<b>Browser (User Agent) Info:</b><br/>" . $browser . "<br/>";
echo "<b>Referrer:</b><br/>" . $referrer . "<br/>";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment