PHP Classes

File: test.php

Recommend this page to a friend!
  Classes of Valerio Giuffrida   IP_to_country   test.php   Download  
File: test.php
Role: Example script
Content type: text/plain
Description: Test script
Class: IP_to_country
Determine the country of an IP address using Whois
Author: By
Last change:
Date: 17 years ago
Size: 652 bytes
 

Contents

Class file image Download
<?php
include("ip2country.class.php");
$a = new ip2country("countries.txt","flags/");
$arr=$a->parseIP("85.46.225.56");
echo
"<img src=\"".$arr[2]."\" title=\"".$arr[1]."\">".$arr[0]."<br />";

$arr=$a->parseIP("217.87.11.238");
echo
"<img src=\"".$arr[2]."\" title=\"".$arr[1]."\">".$arr[0]."<br />";


$arr=$a->parseIP("85.254.90.8");
echo
"<img src=\"".$arr[2]."\" title=\"".$arr[1]."\">".$arr[0]."<br />";

$arr=$a->parseIP("195.12.55.6");
echo
"<img src=\"".$arr[2]."\" title=\"".$arr[1]."\">".$arr[0]."<br />";

$arr=$a->parseIP("62.78.137.162");
echo
"<img src=\"".$arr[2]."\" title=\"".$arr[1]."\">".$arr[0]."<br />";
?>