Comunitatea PHP Romania
 

 
Net_Geo - Example

Net_Geo - Example

Net_Geo - Example -- tracking down the remote client IP

Example

<?php

require_once('Net/Geo.php');

// new Net_Geo object
$net_geo = new Net_Geo();

// fetch the client's IP
$ip = $_SERVER['REMOTE_ADDR'];

// fetch information array from net_geo
$results = $net_geo->getRecord($ip);

// output
echo "Single IP results:<br />";
echo "<pre>";
print_r($results);
echo "</pre>";

// example array of multiple IPs
$arr_ips = array
(
  gethostbyname("www.google.com"),
  gethostbyname("www.heise.de"),
  gethostbyname("www.college.ch")
);

// fetch information array from net_geo
$results = $net_geo->getRecord($arr_ips);

// output
echo "Multiple IP results:<br />";
echo "<pre>";
print_r($results);
echo "</pre>";

?>

Ultimele discutii in forum RSS Forum

Ultimele articole Ultimele articole

Top membri

Pirahna Pirahna
la birou
carco carco
Bucuresti
Birkoff Birkoff
Bucuresti
mihaitha mihaitha
Sibiu
Mascka Mascka
Braila
gabysolomon gabysolomon
Bacau
whooper whooper
Toronto ON
raul_ raul_
dechim dechim
Drobeta Turnu Severin
Amenthes Amenthes

Newsletter


Email:
 inscriere
 renuntare
 
 Arhiva newsletter

Parteneriat

Copyright © 2001-2009 PHP Romania Add PHPRomania to Google Add PHPRomania to Del.icio.us Add PHPRomania to Stumbleupon Add PHPRomania to Yahoo! Add PHPRomania to Digg Add PHPRomania to Blink Guitar Lessons | Web Advertising | Loans | vShare YouTube Clone | Credit Card
Ads: Partener Way2Web Nework: gazduire web | inregistrare domenii | web design | imobiliare | web hosting
Powered by Simplis