if (isset($_GET['versm'])) {
if ($_GET['versm'] == 'full') {
setcookie('mobile', '1', time()+9999999, '/', 'domain.ru');
header('Location: http://www.domain.ru');
}
}
if ($_COOKIE['mobile'] != '1') {
if ($iphone || $ipod || $android || $symb || $operam || $htc || $winphone || $berry === true) {
setcookie('mobile', '2', time()+9999999, '/', 'domain.ru');
header('Location: http://m.domain.ru');
}
}