Mobil cihazları tespit etmek için komut nedir

0 Cevap php

Ben, benim sitenin 2versions yapmak zorunda yani, cep telefonu ve PC için 1 sürümü için 1 sürümü. Aşağıdaki gibi Yani bir komut dosyası var: -

<?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;
}
?>

Bu komut benim PC ile iyi çalışır, ama ben mobil siteme erişmeye çalışırsanız ben istiyorum, ben aynı sayfaya yönlendirme olamaz.

Herkes bana bu sorunu çözmeye yardımcı olabilir?

Şimdiden teşekkürler.

0 Cevap