휴대 전화 용 버전 1 개와 PC 용 버전 1 개를 만들어야합니다. 그래서 다음과 같이 나는 스크립트를 가지고있다 -휴대 기기를 감지하는 스크립트는 무엇입니까
<?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와 함께 잘 작동하지만 모바일에서 내 사이트에 액세스하려고하면 내가 원하는대로, 나는 같은 페이지로 리디렉션 할 수 없습니다.
누구든지 나를 도와 드릴까요?
미리 감사드립니다.
가능한 중복 [모바일 브라우저 기능을 감지하는 방법 (http://stackoverflow.com/questions/3428234/how-to-detect-mobile-browser : 여기 –
Sarfraz에서 @Pekka 대부분의 링크 게시물 불행히도 작동하지 않습니다 – Sotiris