PHP code to show visitor’s informations

Here’s some simple info displaying your IP address, browser info, and
the address that referred you to the page:
{code codetype=php}<?php
$your_ip = $_SERVER['REMOTE_ADDR'];
$your_hostaddress = gethostbyaddr($your_ip);
$your_browser = $_SERVER['HTTP_USER_AGENT'];
$referred = $_SERVER['HTTP_REFERER'];

print “<strong>IP address:</strong><br />\n”;
print “$your_ip<br /><br />\n”;
print “<strong>Host address:</strong><br />\n”;
print “$your_hostaddress<br /><br />\n”;
print “<strong>Your browser info</strong>:<br />\n”;
print “$your_browser<br /><br />\n”;
print “<strong> Where you came from :</strong>:<br />\n”;
if($referred)
{
print “$referred”;
}
else
{
print “refresh your browser”;
}
?>{/code}

VN:F [1.9.17_1161]
Rating: 0.0/10 (0 votes cast)
VN:F [1.9.17_1161]
Rating: 0 (from 0 votes)

Related Posts

  • No Related Post
Related Posts with Thumbnails

About the Author

techremind

has written 42 stories on this site.

Write a Comment

Copyright © 2012 CoreTimer.com|System Admin’s Reference. All rights reserved.

Switch to our mobile site