PHP Classes
Icontem

File: geoip-test.php


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend! ReTweet ReTweet Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Marius Zadara  >  GeoIP Country Whois Locator  >  geoip-test.php  
File: geoip-test.php
Role: Example script
Content type: text/plain
Description: Class use example
Class: GeoIP Country Whois Locator
Determine the country of an IP address using GeoIP
 

Contents

Class file image Download
<?php


    
require_once("includes/classes/geoip.php");

    
$objGeoIP = new GeoIP();
    
$objGeoIP->search_ip("<YOUR IP>");

    if (
$objGeoIP->found())
    {
        echo 
"Country Code: "     $objGeoIP->getCountryCode()     . "<br/>";
        echo 
"Country Name: "     $objGeoIP->getCountryName()     . "<br/>";
        echo 
"IP Class Start: " $objGeoIP->getStartIp()         . "<br/>";
        echo 
"IP Class End: "     $objGeoIP->getEndIp()         . "<br/>";
    }
    else
        echo 
"NOT FOUND!";


?>


 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2009 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products