Benim PHP Server Net_Geo armut paketi yüklü.
Bu ben kullanıyorum kodu,
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>";
>
But this piece of code is not displaying any results. I think this code is not working at all.
Bu Net_Geo Nesnesi
Net_Geo Object ( [cache_path] => /tmp/ [cache_ttl] => 30 [default_timeout] => 60 [default_caida_server] => http://netgeo.caida.org/perl/netgeo.cgi [default_hostip_server] => http://api.hostip.info/ [localizer_data] => ./demo.csv [service] => [cache_prefix] => netgeo [useragent] => PHP/NetGeo [useragent_version] => 1.0 [array_limit] => 100 [cache] => Cache_Function Object ( [expires] => 2592000 [caching] => 1 [gc_time] => 1 [gc_probability] => 1 [gc_maxlifetime] => 86400 [container] => Cache_Container_file Object ( [fileLocking] => [cache_dir] => /tmp/ [filename_prefix] => netgeo [entries] => Array ( )
[total_size] => 0
[max_userdata_linelength] => 257
[preload] => 1
[id] =>
[group] =>
[expires] => 0
[cachedata] =>
[userdata] =>
[unknown] => 1
[encoding_mode] => base64
[highwater] => 2048000
[lowwater] => 1536000
[allowed_options] => Array
(
[0] => encoding_mode
[1] => highwater
[2] => lowwater
)
[group_dirs] => Array
(
)
)
[_debug] =>
[_default_error_mode] =>
[_default_error_options] =>
[_default_error_handler] =>
[_error_class] => PEAR_Error
[_expected_errors] => Array
(
)
)
[netgeo_global] => netgeo_global
[useragent_string] =>
[default_server] =>
[last_target] =>
[applicationName] =>
[alternateServerUrl] =>
)
Teşekkürler