Location: PHPKode > scripts > Infosniper Geolocation XML API > infosniper-geolocation-xml-api/PHP4/infosniper_example_query.php
<?php
 //----------------------------------------------
 // Infosniper Geolocation Service
 // Release Date 2010/03/27
 //----------------------------------------------

 //----------------------------------------------
 // Include infosniper_IPQuery Function
 include ( "infosniper_IPQuery.php" );
 //----------------------------------------------
 // Personal Query Key - Please enter your personal query key here
 $infosniper_queryKey = "";

 // Query Result Language - Please choose the language of the query results
 // 1 - english (default if not set)
 // 2 - german
 // 3 - espanol
 $infosniper_queryLanguage = "";
 //----------------------------------------------
 $infosniper_queryResults = infosniper_IPQuery ( $infosniper_queryKey , $infosniper_queryLanguage );

 if ( $infosniper_queryResults [ "hostname"    ] != "Quota exceeded" )
  {
   //----------------------------------------------
   echo $infosniper_queryResults [ "ipaddress"   ];
   echo "<br>";
   echo $infosniper_queryResults [ "hostname"    ];
   echo "<br>";
   echo $infosniper_queryResults [ "provider"    ];
   echo "<br>";
   echo $infosniper_queryResults [ "country"     ];
   echo "<br>";
   echo $infosniper_queryResults [ "countrycode" ];
   echo "<br>";
   echo "<img src=\"".$infosniper_queryResults [ "countryflag" ]."\" border=\"0\">";
   echo "<br>";
   echo $infosniper_queryResults [ "state"       ];
   echo "<br>";
   echo $infosniper_queryResults [ "city"        ];
   echo "<br>";
   echo $infosniper_queryResults [ "areacode"    ];
   echo "<br>";
   echo $infosniper_queryResults [ "postalcode"  ];
   echo "<br>";
   echo $infosniper_queryResults [ "dmacode"     ];
   echo "<br>";
   echo $infosniper_queryResults [ "timezone"    ];
   echo "<br>";
   echo $infosniper_queryResults [ "gmtoffset"   ];
   echo "<br>";
   echo $infosniper_queryResults [ "continent"   ];
   echo "<br>";
   echo $infosniper_queryResults [ "latitude"    ];
   echo "<br>";
   echo $infosniper_queryResults [ "longitude"   ];
   echo "<br>";
   echo $infosniper_queryResults [ "queries"     ];
   //----------------------------------------------
  }
 //----------------------------------------------
?>
Return current item: Infosniper Geolocation XML API