-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinfo.php
43 lines (31 loc) · 1.19 KB
/
info.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
require_once "Net/GeoIP.php";
$geoip = Net_GeoIP::getInstance("/Users/hollarab/code/php/adadapted/aa-core/data/geoip/GeoLiteCity.dat");
try {
$location = $geoip->lookupLocation('192.69.23.17');
echo("<p>Longmont: ".$location."</p>");
$location = $geoip->lookupLocation('208.54.38.214');
echo("<p>T-Mobile: ".$location."</p>");
// $location = $geoip->lookupCountryName('192.69.23.17');
// echo("<p>".$location."</p>");
// $location = $geoip->lookupCountryCode('192.69.23.17');
// echo("<p>".$location."</p>");
$location = $geoip->lookupLocation('173.14.36.209');
echo("<p>Chris: ".$location."</p>");
$location = $geoip->lookupLocation('192.69.23.17');
if(isset($location)) {
echo($location->countryCode);
// $location->region,
// $location->city,
// $location->postalCode,
// $location->areaCode,
// $location->latitude,
// $location->longitude
}
} catch (Exception $e) {
echo($e);
}
phpinfo();
?>
<!-- 31: echo $geoip->lookupCountryName("98.243.171.253");
33: echo $geoip->lookupCountryCode("98.243.171.253"); -->