Created
November 13, 2015 20:48
-
-
Save SErr0r/cd39198d2f0ff6166526 to your computer and use it in GitHub Desktop.
Show user information (IP address, Browser (User Agent), Referrer)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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