<?php
error_reporting(error_reporting() & ~E_NOTICE); // turn off notice errors
echo highlight_file(__FILE__, true) . "<hr/>"; // show source code
$ip = (isset($_REQUEST["ip"]) ? $_REQUEST["ip"] : $_SERVER["REMOTE_ADDR"]);
$geoip = geoip_record_by_name($ip);
if (!$geoip) die("Invalid address provided in parameter.");
$geoip["remote_address"] = $_SERVER["REMOTE_ADDR"];
echo "<table style=\"font-family:monospace;\">";
foreach ($geoip as $name => $value) echo "<tr><td>$name</td><td>$value</td></tr>";
echo "</table>"
. "<hr/><a href=\"https://maps.google.com/?q="
. urlencode($geoip["latitude"]) . ","
. urlencode($geoip["longitude"]) . "\">"
. "View this on Google Maps</a>";
continent_code | NA |
country_code | US |
country_code3 | USA |
country_name | United States |
region | OH |
city | Columbus |
postal_code | 43215 |
latitude | 39.965301513672 |
longitude | -83.023498535156 |
dma_code | 535 |
area_code | 614 |
remote_address | 18.188.119.67 |
View this on Google Maps