Location: PHPKode > scripts > IP to Country classes > ip-to-country-classes/testclass.php
<?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 !";
			  
//-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
?>
Return current item: IP to Country classes