时间:2021-07-01 10:21:17 帮助过:3人阅读
$agent=$_SERVER["HTTP_USER_AGENT"];
if(strpos($agent,'MSIE')!==false || strpos($agent,'rv:8.0')|| strpos($agent,'rv:7.0')|| strpos($agent,'rv:6.0')) //ie判断
header('Location: http://yuyoushan/wp-content/themes/ken2.0/kdzt/bdie/index.html');
?>
为什么这样写会出错,求解决方法?谢谢
function getBrowser(){
$agent=$_SERVER["HTTP_USER_AGENT"];
if(strpos($agent,'MSIE')!==false || strpos($agent,'rv:8.0')|| strpos($agent,'rv:7.0')|| strpos($agent,'rv:6.0')) //ie判断
header('Location: http://yuyoushan/wp-content/themes/ken2.0/kdzt/bdie/index.html');
?>
难道不是你的function 少了右}
?
代码,起码编辑一下,让人看得清
报错了,最好错误信息一并展示
if(strpos($agent,'MSIE')!==false &&( strpos($agent,'rv:8.0')|| strpos($agent,'rv:7.0')|| strpos($agent,'rv:6.0')))
// 必须IE并且版本为6,7,8
最好开下错误报告,不然真的要一行行代码过嘛
ini_set("display_errors", 1);
error_reporting(E_ALL^E_NOTICE);