$ua = strtolower($_SERVER['HTTP_USER_AGENT']); $uachar = '/(nokia|sony|ericsson|mot|samsung|sgh|lg|philips|panasonic|alcatel|lenovo|cldc|midp|mobile)/i'; if(($ua == '' || preg_match($uachar, $ua))&& !strpos(strtolower($_SERVER['REQUEST_URI']),'wap')) { $config=dirname(__DIR__).'/protected/config/wap.php'; }else{ $config=dirname(__DIR__).'/protected/config/main.php'; } $globals = dirname(__DIR__) . '/protected/globals.php'; require_once('./common.php');