Файл: Dvig/bro.php
Строк: 43
<?php
include_once ( 'core/core.php' ) ;
include_once ( 'core/head.php' ) ;
function detect_mobile_device(){
if(stristr(@$_SERVER['HTTP_USER_AGENT'],'windows')&&!stristr(@$_SERVER['HTTP_USER_AGENT'],'windows ce')) return false;
if(preg_match('/up.browser|up. link |windows ce|iemobile|mini|mmp|symbian|midp|wap|phone|pocket|mobile|pda|psp/i',
@$_SERVER['HTTP_USER_AGENT'])) return true;
if(isset($_SERVER['HTTP_ACCEPT'])&&(stristr($_SERVER['HTTP_ACCEPT'],'text/vnd.wap.wml')||
stristr($_SERVER['HTTP_ACCEPT'],'application/vnd.wap.xhtml xml'))) return true;
if(isset($_SERVER['HTTP_X_WAP_PROFILE'])||isset($_SERVER['HTTP_PROFILE'])||
isset($_SERVER['X-OperaMini-Features'])||isset($_SERVER['UA-pixels'])) return true;
$a = array ('acs-','alav','alca','amoi','audi','aste','avan','benq','bird','blac',
'bla z','brew','cell','cldc','cmd-','dang','doco','eric','hipt','inno',
'ipaq','java', 'jigs','kddi','keji','leno','lg-c','lg-d','lg-g','lge-',
'maui','maxo','midp','mi ts','mmef','mobi','mot-','moto','mwbp','nec-',
'newt','noki','opwv','palm','pana' ,'pant','pdxg','phil','play','pluc',
'port','prox','qtek','qwap','sage','sams','s any','sch-','sec-','send',
'seri','sgh-','shar','sie-','siem','smal','smar','sony ','sph-','symb',
't-mo','teli','tim-','tosh','tsm-','upg1','upsi','vk-v','voda',' w3c ',
'wap-','wapa','wapi','wapp','wapr','webc','winw','winw','xda','xda-');
if(isset($a[ substr (@$_SERVER['HTTP_USER_AGENT'],0,4)])) return true;}
if (detect_mobile_device()){
# Если с телефона
$city = '1';}
else {
# Если с ПК
$city = '2';}
?>
<?
function get_database_tables()
{
$ret = array();
$r = mysql_query("SHOW TABLES");
if (mysql_num_rows($r)>0)
while($row = mysql_fetch_array($r, MYSQL_NUM))
$ret[] = $row[0];
return $ret;
}
?>