File: vendor/geoip/geoip/examples/org.php

Recommend this page to a friend!
  Classes of Ganesh Kandu  >  kchat  >  vendor/geoip/geoip/examples/org.php  >  Download  
File: vendor/geoip/geoip/examples/org.php
Role: Auxiliary script
Content type: text/plain
Description: Auxiliary script
Class: kchat
Database driven PHP live chat system
Author: By
Last change:
Date: 2 years ago
Size: 610 bytes
 

Contents

Class file image Download
#!/usr/bin/php -q
<?php

// This code demonstrates how to lookup the country and region by IP Address
// It is designed to work with GeoIP Organization or GeoIP ISP available from MaxMind

include("../src/geoip.inc");

$giorg = geoip_open("/usr/local/share/GeoIP/GeoIPOrg.dat", GEOIP_STANDARD);

$org = geoip_org_by_addr($giorg, "80.24.24.24");
print
"80.24.24.24 belongs to " . $org . "\n";

$giisp = geoip_open("/usr/local/share/GeoIP/GeoIPISP.dat", GEOIP_STANDARD);

$isp = geoip_org_by_addr($giisp, "80.24.24.24");
print
"80.24.24.24 has isp " . $isp . "\n";

geoip_close($giorg);
geoip_close($giisp);

?>


For more information send a message to info at phpclasses dot org.