【发布时间】:2010-08-12 10:38:59
【问题描述】:
我必须为我的网站制作 2 个版本,即 1 个手机版本和 1 个 PC 版本。所以我有一个脚本如下:-
<?php
if ( stristr($ua, "Windows CE") or stristr($ua, "AvantGo") or
stristr($ua,"Mazingo") or stristr($ua, "Mobile") or stristr($ua, "T68") or
stristr($ua,"Syncalot") or stristr($ua, "Blazer") or
stristr($ua,"Mozilla") or stristr($ua,"Firefox") )
{
$DEVICE_TYPE="MOBILE";
}
if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE")
{
$location='mobile/entry.html';
header ('Location: '.$location);
exit;
}
else
{
$location='entry.html';
header ('Location: '.$location);
exit;
}
?>
此脚本在我的 PC 上运行良好,但如果我尝试从移动设备访问我的网站,我无法重定向到我想要的同一页面。
谁能帮我解决这个问题?
提前致谢。
【问题讨论】:
-
@Pekka Sarfraz 帖子中的大多数链接都不起作用