PHP Classes

File: testclass.php

Recommend this page to a friend!
  Classes of Pascal Toussaint  >  IP to Country  >  testclass.php  >  Download  
File: testclass.php
Role: Example script
Content type: text/plain
Description: Exemple
Class: IP to Country
Determine the country of a given IP address
Author: By
Last change: Implemente test with the new function (LookRemote)
Date: 18 years ago
Size: 769 bytes
 

Contents

Class file image Download
<?php
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
// MODULE: test
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
header("Pragma: no-cache");
header("Cache-Control: no-cache");

require_once(
"class.ip2country.php");

$ip = $_SERVER["REMOTE_ADDR"];

$iplook = new ip2country($ip);

//$iplook->UseDB = true;
//$iplook->db_login = "PascalZ";
//$iplook->db_password = "*******";
//$iplook->db_basename = "webdata";

if (($iplook->LookRemote())||($iplook->LookUp()))
{
    echo
"You come from ".$iplook->Country." ( ".$iplook->Prefix1." )";
}
else echo
"I don't know where you come from !";
             
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
?>