- <?php
-
- $ip = $_SERVER['REMOTE_ADDR'];
- $ips = split("\.", "$ip");
- @$ipnum = $ips[3] + $ips[2] * 256 + $ips[1] * 256 * 256 + $ips[0] * 256 * 256 * 256;
- $oper = '';
- $IP101 = array(2130706433,1402273792,1402277888,1402279936,1402281984,1402284032,1402286080,1402287104,3251233792,3582031776);
- $IP201 = array(2130706687,1402275839,1402278911,1402280959,1402283007,1402285055,1402287103,1402288127,3251234815,3582031807);
- $IP102 = array(1433657344,3648405504,3648406528,3648408576,3648409600,3648410624,3648411648,3648412672);
- $IP202 = array(1433657599,3648406527,3648407551,3648409599,3648410623,3648411647,3648412671,3648413695);
- $IP103 = array(1047070464,1401450496,1401451520,1406861312,1425989632,1441366016,3272364544,3564675072,3564676832,3571187712,3641816064,3641816576);
- $IP203 = array(1047072255,1401450751,1401451775,1406869503,1425994239,1441371903,3272364799,3564683263,3564676863,3571253247,3641816319,3641816831);
- $IP104 = array(1347599104,3588519936);
- $IP204 = array(1347599359,3588520447);
- $IP105 = array(1042394624,1346950400,1347674112,1360933376,1372794624,1410457600,3258356736,3277188608,3281465344,3287259392,3559689216,3562834880,3578831872,3579259392,3579267072,3579269120,3641237504,3641237504,3645018112,3645566976,3648478720);
- $IP205 = array(1042394879,1346950655,1347678207,1360933887,1372794879,1410459647,3258357759,3277188863,3281465599,3287259647,3559689471,3562834943,3578832127,3579265535,3579267935,3579273215,3641241599,3641240575,3645019135,3645569023,3648479231);
- $IP106 = array(1404043264,2197028864);
- $IP206 = array(1405091839,2197094399);
- $IP107 = array(3650368512);
- $IP207 = array(3650368767);
- $IP108 = array(3278955480,3278956288,3278960128);
- $IP208 = array(3278955515,3278956543,3278960383);
- $IP109 = array(1389383040,1432330240,3282161664,3282171904,3585171456);
- $IP209 = array(1389383167,1432334335,3282163711,3282173951,3585174271);
- $IP110 = array(1346736128,3260286336,3645731072);
- $IP210 = array(1346737151,3260286463,3645731079);
- $IP111 = array(3648294912);
- $IP211 = array(3648295935);
- $IP112 = array(1481787392,3652001536);
- $IP212 = array(1481787647,3652001599);
- $IP113 = array(1052193280,1347125248,1347125248,1347126528);
- $IP213 = array(1052193535,1347129343,1347125759,1347127167);
- $IP114 = array(1358118912,1358119680);
- $IP214 = array(1358119423,1358123007);
- $IP115 = array(1406740480,1406741504,3564593152,3564595968,3564599808,3565248512,3565250048,3565250560,3578853376,3648215680);
- $IP215 = array(1406741503,1406743551,3564593407,3564596735,3564601343,3565256703,3565250559,3565254655,3578854079,3648215807);
- $IP116 = array(3651751936,3651752192,3651755008);
- $IP216 = array(3651752191,3651752447,3651756031);
- $IP117 = array(3287244288);
- $IP217 = array(3287244543);
- $IP118 = array(3645317120);
- $IP218 = array(3645318015);
- $IP119 = array(3268669440);
- $IP219 = array(3268673535);
- $IP120 = array(2197028864);
- $IP220 = array(2197094399);
- $IP121 = array(3588390912,1410269184);
- $IP221 = array(3588391935,1410334719);
- $IP122 = array(3266322432);
- $IP222 = array(3266322687);
- $IP123 = array(2197028864);
- $IP223 = array(2197094399);
- $IP124 = array(2197028864);
- $IP224 = array(2197094399);
- $IP125 = array(3562882304);
- $IP225 = array(3563086079);
- $IP300 = array(3240705024);
- $IP301 = array(3240706047);
- $IP302 = array(1358905344,1358905344,1358907392,1358907648,1358907904,1358908160,1358908416,1358908672,1358908928,1358909184,1490436096);
- $IP303 = array(1358909439,1358905471,1358907647,1358907903,1358908159,1358908415,1358908671,1358908927,1358909183,1358909439,1490444287);
- $IP304 = array(3560612352,3560612864);
- $IP305 = array(3560612863,3560613887);
- $IP306 = array(3253698560);
- $IP307 = array(3253699071);
- $IP308 = array(3274702592);
- $IP309 = array(3274702847);
- $IP310= array(3557661440,3563233536,3583086592);
- $IP311 = array(3557661695,3563233791,3583087103);
- $IP312= array(1410273024,3588391680,2197079040,3588406784,3588407040);
- $IP313 = array(1410273279,3588391935,2197079295,3588407039,3588407295);
-
- for ($ix=0; $ix<count($IP101); $ix++)
- {
- if ($ipnum>=$IP101[$ix] && $ipnum<=$IP201[$ix]) $oper = "1";
- }
- for ($ix=0; $ix<count($IP102); $ix++)
- {
- if ($ipnum>=$IP102[$ix] && $ipnum<=$IP202[$ix]) $oper = "2";
- }
- for ($ix=0; $ix<count($IP103); $ix++)
- {
- if ($ipnum>=$IP103[$ix] && $ipnum<=$IP203[$ix]) $oper = "3";
- }
- for ($ix=0; $ix<count($IP104); $ix++)
- {
- if ($ipnum>=$IP104[$ix] && $ipnum<=$IP204[$ix]) $oper = "4";
- }
- for ($ix=0; $ix<count($IP105); $ix++)
- {
- if ($ipnum>=$IP105[$ix] && $ipnum<=$IP205[$ix]) $oper = "5";
- }
- for ($ix=0; $ix<count($IP106); $ix++)
- {
- if ($ipnum>=$IP106[$ix] && $ipnum<=$IP206[$ix]) $oper = "6";
- }
- for ($ix=0; $ix<count($IP107); $ix++)
- {
- if ($ipnum>=$IP107[$ix] && $ipnum<=$IP207[$ix]) $oper = "7";
- }
- for ($ix=0; $ix<count($IP108); $ix++)
- {
- if ($ipnum>=$IP108[$ix] && $ipnum<=$IP208[$ix]) $oper = "8";
- }
- for ($ix=0; $ix<count($IP109); $ix++)
- {
- if ($ipnum>=$IP109[$ix] && $ipnum<=$IP209[$ix]) $oper = "9";
- }
- for ($ix=0; $ix<count($IP110); $ix++)
- {
- if ($ipnum>=$IP110[$ix] && $ipnum<=$IP210[$ix]) $oper = "10";
- }
- for ($ix=0; $ix<count($IP111); $ix++)
- {
- if ($ipnum>=$IP111[$ix] && $ipnum<=$IP211[$ix]) $oper = "11";
- }
- for ($ix=0; $ix<count($IP112); $ix++)
- {
- if ($ipnum>=$IP112[$ix] && $ipnum<=$IP212[$ix]) $oper = "12";
- }
- for ($ix=0; $ix<count($IP113); $ix++)
- {
- if ($ipnum>=$IP113[$ix] && $ipnum<=$IP213[$ix]) $oper = "13";
- }
- for ($ix=0; $ix<count($IP114); $ix++)
- {
- if ($ipnum>=$IP114[$ix] && $ipnum<=$IP214[$ix]) $oper = "14";
- }
- for ($ix=0; $ix<count($IP115); $ix++)
- {
- if ($ipnum>=$IP115[$ix] && $ipnum<=$IP215[$ix]) $oper = "15";
- }
- for ($ix=0; $ix<count($IP116); $ix++)
- {
- if ($ipnum>=$IP116[$ix] && $ipnum<=$IP216[$ix]) $oper = "16";
- }
- for ($ix=0; $ix<count($IP117); $ix++)
- {
- if ($ipnum>=$IP117[$ix] && $ipnum<=$IP217[$ix]) $oper = "17";
- }
- for ($ix=0; $ix<count($IP118); $ix++)
- {
- if ($ipnum>=$IP118[$ix] && $ipnum<=$IP218[$ix]) $oper = "18";
- }
- for ($ix=0; $ix<count($IP119); $ix++)
- {
- if ($ipnum>=$IP119[$ix] && $ipnum<=$IP219[$ix]) $oper = "19";
- }
- for ($ix=0; $ix<count($IP120); $ix++)
- {
- if ($ipnum>=$IP120[$ix] && $ipnum<=$IP220[$ix]) $oper = "20";
- }
- for ($ix=0; $ix<count($IP121); $ix++)
- {
- if ($ipnum>=$IP121[$ix] && $ipnum<=$IP221[$ix]) $oper = "21";
- }
- for ($ix=0; $ix<count($IP122); $ix++)
- {
- if ($ipnum>=$IP122[$ix] && $ipnum<=$IP222[$ix]) $oper = "22";
- }
- for ($ix=0; $ix<count($IP123); $ix++)
- {
- if ($ipnum>=$IP123[$ix] && $ipnum<=$IP223[$ix]) $oper = "23";
- }
- for ($ix=0; $ix<count($IP124); $ix++)
- {
- if ($ipnum>=$IP124[$ix] && $ipnum<=$IP224[$ix]) $oper = "24";
- }
- for ($ix=0; $ix<count($IP125); $ix++)
- {
- if ($ipnum>=$IP125[$ix] && $ipnum<=$IP225[$ix]) $oper = "25";
- }
- for ($ix=0; $ix<count($IP300); $ix++)
- {
- if ($ipnum>=$IP300[$ix] && $ipnum<=$IP301[$ix]) $oper = "26";
- }
- for ($ix=0; $ix<count($IP302); $ix++)
- {
- if ($ipnum>=$IP302[$ix] && $ipnum<=$IP303[$ix]) $oper = "27";
- }
- for ($ix=0; $ix<count($IP304); $ix++)
- {
- if ($ipnum>=$IP304[$ix] && $ipnum<=$IP305[$ix]) $oper = "28";
- }
- for ($ix=0; $ix<count($IP306); $ix++)
- {
- if ($ipnum>=$IP306[$ix] && $ipnum<=$IP307[$ix]) $oper = "29";
- }
- for ($ix=0; $ix<count($IP308); $ix++)
- {
- if ($ipnum>=$IP308[$ix] && $ipnum<=$IP309[$ix]) $oper = "30";
- }
- for ($ix=0; $ix<count($IP310); $ix++)
- {
- if ($ipnum>=$IP310[$ix] && $ipnum<=$IP311[$ix]) $oper = "30";
- }
- for ($ix=0; $ix<count($IP312); $ix++)
- {
- if ($ipnum>=$IP312[$ix] && $ipnum<=$IP313[$ix]) $oper = "31";
- }
-
- ////////// Дописываем мод определителя.
- $opera = array(ip2long("195.189.142.0"),ip2long("195.189.143.255"));
-
-
- ////МТС
-
- $ipnum = array(ip2long("87.252.242.0"),ip2long("87.252.242.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("91.135.210.0"),ip2long("91.135.210.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("84.17.232.0"),ip2long("84.17.233.255")); // 512
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("195.74.84.0"),ip2long("195.74.84.255")); // 256
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("217.21.61.0"),ip2long("217.21.61.255")); // 256
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("217.107.118.0"),ip2long("217.107.118.255")); // 256
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("194.186.210.0"),ip2long("194.186.210.128")); // 128
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("85.117.224.0"),ip2long("85.117.224.255")); // 256
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- /// 1164
-
-
- //// Чина телеком
- $ipnum = array(ip2long("61.140.0.0"),ip2long("61.146.255.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- //// Лайф 512 + 3840 + 32512 +256 + 1792 + 16128 = 55 040
- $ipnum = array(ip2long("91.145.224.0"),ip2long("91.145.255.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("212.58.176.0"),ip2long("212.58.191.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("79.124.128.0"),ip2long("79.124.255.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("212.58.160.0"),ip2long("212.58.160.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("212.58.168.0"),ip2long("212.58.175.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("91.145.192.0"),ip2long("91.145.255.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- ///// Тамбов GSM 3840 = 3840
- $ipnum = array(ip2long("213.135.143.128"),ip2long("213.135.158.127"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- ///// UMC 1792 + 7936 + 1792 = 11 520
- $ipnum = array(ip2long("77.52.128.0"),ip2long("77.52.135.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("88.214.96.0"),ip2long("88.214.127.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("77.52.136.0"),ip2long("77.52.143.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
-
- /// WellCOM GSM 16 128
- $ipnum = array(ip2long("213.227.192.0"),ip2long("213.227.255.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- //// Байкалвестком 256 + 3840 = 4 096
- $ipnum = array(ip2long("81.18.116.0"),ip2long("81.18.117.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("81.18.112.0"),ip2long("81.18.127.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- ////БашСЕЛ 768 + 256 = 1024
-
- $ipnum = array(ip2long("195.22.108.0"),ip2long("195.22.111.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("82.151.17.0"),ip2long("82.151.17.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
- ///// 93 312
- //// ВымпелКом 768 + 768 = 1536
- $ipnum = array(ip2long("89.188.224.0"),ip2long("89.188.227.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
- $ipnum = array(ip2long("83.220.224.0"),ip2long("83.220.227.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
-
- //// Дальсвязь 256
- $ipnum = array(ip2long("85.28.195.0"),ip2long("85.28.195.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
- //// ИНДИГО 768
- $ipnum = array(ip2long("82.200.40.0"),ip2long("82.200.43.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
- ////КаР-Тел 256
- $ipnum = array(ip2long("77.74.64.0"),ip2long("77.74.64.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- ////Киевстар 1792 + 1792 = 3584
- $ipnum = array(ip2long("81.23.24.0"),ip2long("81.23.31.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("81.23.16.0"),ip2long("81.23.23.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- //// МегаФон 768 + 768 + 768 = 2304
- $ipnum = array(ip2long("83.149.8.0"),ip2long("83.149.11.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("83.149.20.0"),ip2long("83.149.23.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("80.67.208.0"),ip2long("80.67.211.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
- ///// 102 016
- $ipnum = array(ip2long("89.20.97.0"),ip2long("89.20.97.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("212.92.139.0"),ip2long("212.92.139.191"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
- $ipnum = array(ip2long("81.95.164.0"),ip2long("81.95.167.255"));
- if(ip2long($ip) >= $ipnum[0] and ip2long($ip) <= $ipnum[1])
- $oper = 1;
-
-
- if(!empty($oper))
- {
- $my_type=1; // мобила
- $brow = 'Мобила';
- }
- elseif(ip2long($ip) >= @$opera[0] and ip2long($ip) <= @$opera[1])
- {
- $my_type=2; // Опера
- $brow = 'Мини-Опера';
- }
- else
- {
- $my_type=3; // Комп
- $brow = 'Комп';
- }
-
- ?>