0

PHPEVAL $o='';

include_once $GLOBALS['include_sys'].'geoip.php';

if(isset($_SERVER['HTTP_CF_IPCOUNTRY'])) {

$L=$_SERVER['HTTP_CF_IPCOUNTRY'];

$o.='<div><i class="flag-'.$L.'"></i>'

.' <b>'.$L.' '.$GLOBALS['flagistran'][$L].'</b>';

}

$x='HTTP_CF_CONNECTING_IP';

if(!isset($_SERVER[$x])) $x='HTTP_X_FORWARDED_FOR';

if(!isset($_SERVER[$x])) $x='REMOTE_ADDR';

$ip=h($_SERVER[$x]);

$o.='<p>Ваш IP: <b>'.$ip.'</b> ('.$x.')';

$o.='<p>Браузер: <b>'.h($_SERVER['HTTP_USER_AGENT']).'</b>';

$j=@file_get_contents('https://ipinfo.io/'.$ip.'/json',false,stream_context_create(['http'=>['timeout'=>1]]));

$m=(array)json_decode($j);

foreach($m as $n=>$l) {

if($n=='readme') continue;

$o.='<div>'.h($n).': <tt>'.h($l).'</tt></div>';

}

if(!empty($m['loc'])){

list($x,$y)=explode(',',$m['loc']);

// $o.="<div>x=[$x] y=[$y]</div>";

$o.="<script> page_onstart.push('gogo($y,$x)'); </script>"

.'<p><div id="myMapId" style="width:500px; height:400px; position:relative;z-index:1;"></div>'
;

}

$r=geoip_whois($GLOBALS['IP']);

$o.='<p>'.(empty($r['inetnum']) ? ''
: 'inetnum: '.$r['inetnum'].'
country: '.$r['country'].'
city: '.$r['city'].'
<pre class=br>'.h($r['a']).'</pre>');

return $o; disabled.