Display PHP + server info
65
Quick snippet today meant as a copy/paste template for displaying your PHP and server information in the blink of an eye.
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
<? // display PHP + server infos $ip_address = $_SERVER['REMOTE_ADDR']; $host_address = gethostbyaddr($ip_address); $user_agent = $_SERVER['HTTP_USER_AGENT']; $referrer = $_SERVER['HTTP_REFERER']; echo "<p><strong>IP address:</strong> " . $ip_address . "</p>" . "\n"; echo "<p><strong>Host address:</strong> " . $host_address . "</p>" . "\n"; echo "<p><strong>User agent:</strong> " . $user_agent . "</p>" . "\n"; echo "<p><strong>Referrer:</strong> "; if ($referrer == "") { echo "[ no referrer ]" . "</p>"; } else { echo "$referrer" . "</p>"; } ?> |
Show Support
Like our new Facebook Page to show support!