Misafir adlı üyeden alıntı: mesajı görüntüle
Mobiledetect çok kapsamlı bir sınıftır. Size tüm seçenekleri sunar.
İstediğiniz şekilde özelleştirebilir ya da kullanabilirsiniz.
Şuan iş yerinde olduğum için her siteye erişimim yok maalesef.
Sadece mobilcihazın adını/modelini istiyorsanız da yine benzer şekilde yazabilirsiniz.
True dönen fonksiyonun adını alabilirsiniz ya da tek tek if-elseif-else sorgusu yazarak halledebilirsiniz.

NOT: akşam bunun hakkında bir fonksiyon yazarak konu altından cevaplayacağım, dediğim gibi iş yerinde olduğum için tam ilgilenemiyorum.


include("core/classes/Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isiPhone())
{
    $device = 'iPhone';
} elseif ($detect->isBlackberry())
{
    $device = 'Blackberry';
} elseif ($detect->isHTC())
{
    $device = 'HTC';
} elseif ($detect->isNexus())
{
    $device = 'Nexus';
} elseif ($detect->isSamsung())
{
    $device = 'Samsung';
} elseif ($detect->isAsus())
{
    $device = 'Asus';
} elseif ($detect->isSony())
{
    $device = 'Sony';
} elseif ($detect->isLG())
{
    $device = 'LG';
} else
{
    $device = 'Other';
}
Merhaba, ilginiz için çok teşekkür ederim. Mesajınızı bugün gördüm. Evet bende benzer bir yol işleyerek devam ediyorum. Telefon modellerini de almam gerektiği için şöyle oluyor

<?php

include "/Mobile_Detect.php";
$cihaz = new Mobile_Detect();

if($cihaz->isMobile()==TRUE or $cihaz->isTablet()==TRUE ){
//echo htmlentities($_SERVER['HTTP_USER_AGENT']);
if (strpos($_SERVER['HTTP_USER_AGENT'], "SM-E500H") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=Samsung%20e5');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "SM-N910C") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=Note%204');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "iPhone") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=iphone');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "SM-N910CQ") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=Note%204');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "SM-A300H") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=Samsung%20a3');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "SM-N9000Q") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=Samsung%20Note%204');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "SM-C101") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "Discovery") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=General%20Mobile%20Discovery');
}elseif(strpos($_SERVER['HTTP_USER_AGENT'], "GT-I9190") !== FALSE){
header('Location: http://www.m.telefoncu.com.tr/index.php?route=product/search&search=Samsung%20S4');
}else{
header('Location: http://www.m.telefoncu.com.tr');
}}
else{
}
?>
Şuanda sorunum iphoneları 4 5 6 diye ayırmak. Birde Nokia Lumialar var. Diğer telefonlarda istedigim gibi oluyor. Çok teşekkür ederim.