<?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
region
city
postal_code
latitude37.750999450684
longitude-97.821998596191
dma_code0
area_code0
remote_address3.231.228.109

View this on Google Maps