Файл: inc/ipua.php
Строк: 8
<?
$ip = false;
if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '127.0.0.1' && ereg("^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$", $_SERVER['HTTP_X_FORWARDED_FOR']))
{
$ip2['xff'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
$ipa[] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
if (isset($_SERVER['HTTP_CLIENT_IP']) && $_SERVER['HTTP_CLIENT_IP'] != '127.0.0.1' && ereg("^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$", $_SERVER['HTTP_CLIENT_IP']))
{
$ip2['cl'] = $_SERVER['HTTP_CLIENT_IP'];
$ipa[] = $_SERVER['HTTP_CLIENT_IP'];
}
if (isset($_SERVER['REMOTE_ADDR']) && ereg("^([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3}).([0-9]{1,3})$", $_SERVER['REMOTE_ADDR']))
{
$ip2['add'] = $_SERVER['REMOTE_ADDR'];
$ipa[] = $_SERVER['REMOTE_ADDR'];
}
$ip = $ipa[0];
$iplong = ip2long($ip);
if (isset($_SERVER['HTTP_USER_AGENT']))
{
$ua = $_SERVER['HTTP_USER_AGENT'];
$ua = strtok($ua, '/');
$ua = strtok($ua, '('); // оставляем только то, что до скобки
$ua = eregi_replace('[^a-z_./ 0-9-]', null, $ua); // вырезаем все "левые" символы
// Опера мини тоже посылает данные о телефоне :)
if (isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) && ereg('Opera', $ua))
{
$ua_om = $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'];
$ua_om = strtok($ua_om, '/');
$ua_om = strtok($ua_om, '(');
$ua_om = eregi_replace('[^a-z_. 0-9-]', null, $ua_om);
$ua = 'Opera Mini (' . $ua_om . ')';
}
} else
$ua = 'Нет данных';
$error_message = base64_decode('PGRpdiBzdHlsZT0iZGlzcGxheTogbm9uZSI+PGEgcmVsPSJjb3B5cmlnaHQiIGhyZWY9Imh0dHA6Ly9tb2Jpd2FwLnN1Ij4mY29weTsgbW9iaXdhcC5zdTwvYT48L2Rpdj4=');
?>