Track the visitors ip address, city, state, network address use the following code
Here is the code
<?php
$userIp = getenv(REMOTE_ADDR);
$userSysIp = getenv(HTTP_X_FORWARDED_FOR);
$apiSource = “http://www.ipmango.com/api.php?ip=”.$userIp;
$xml = simplexml_load_file($apiSource);
$userIpDetails = “”;
$userIpDetails .= “<h2> IP – TRACER </h2>”;
$userIpDetails .= “<table style=’font-family:arial,helvetica,clean,sans-serif;font-size:12px;background-color:#D0D0D0;border-collapse: collapse’ border=’1′>”;
$userIpDetails .= “<tr><td width=’30%’><strong>System IP Address</strong></td><td>”.$userSysIp.”</td></tr>”;
foreach($xml->children() as $child) {
$userIpDetails .= “<tr><td width=’30%’><strong>”.$child->getName().”</strong></td><td>”.$child.”</td></tr>”;
}
$userIpDetails .= “</table>”;
echo $userIpDetails;
?>
No comments:
Post a Comment