<?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_codeNA
country_codeUS
country_code3USA
country_nameUnited States
regionOH
cityColumbus
postal_code43215
latitude39.965301513672
longitude-83.023498535156
dma_code535
area_code614
remote_address18.188.119.67

View this on Google Maps