Login   Register  
PHP Classes
elePHPant
Icontem

File: geoip-test.php

Recommend this page to a friend!
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  >  Download  
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
Author: By
Last change:
Date: 5 years ago
Size: 463 bytes
 

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!";


?>