header('Content-Type: text/html; charset=tis-620'); $chkmobile = $_REQUEST['chkmobile']; $redir = $_REQUEST['redir']; if($chkmobile && $redir){ $rq = urldecode($redir); if($chkmobile == 'yes'){ setcookie("bgmobile", "yes", 0, '/', '.bloggang.com'); header('Location: //www.bloggang.com/m'.$rq); }else{ setcookie("bgmobile", "no", 0, '/', '.bloggang.com'); header('Location: //www.bloggang.com'.$rq); } exit; } if($chkmobile){ if($chkmobile == 'yes'){ setcookie("bgmobile", "yes", 0, '/', '.bloggang.com'); header('Location: //www.bloggang.com/m/index.php'); }else{ setcookie("bgmobile", "no", 0, '/', '.bloggang.com'); header('Location: //www.bloggang.com/index.php'); } exit; } ?>