Hi, I have designed a website for mobile. It is working fine on iPhone but when I tried to open it on Android phone it is not opening mobile site. Here is the link of my site. Welcome to Milano Pizza . Let me know if you can help me. Please find the code below, which i have added on index page to recognize the user agent.
<?php
define('MOBILE_SITE_URL', 'http://www.milanopizzas.co.uk/webpage_mobile/');
if(checkmobile()) header("Location: " . MOBILE_SITE_URL);
function checkmobile(){
$uamatches = array("iPhone", "Trident", "iPod", "midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "Blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto", "palm", "android", "series60");
foreach($uamatches as $uastring)
if(strpos($_SERVER['HTTP_USER_AGENT'], $uastring) !== FALSE) return true;
return false;
}
?>
Please if possilbe reply me at umer@impression.me.uk
Many Thanks,
Kaleem Umer
<?php
define('MOBILE_SITE_URL', 'http://www.milanopizzas.co.uk/webpage_mobile/');
if(checkmobile()) header("Location: " . MOBILE_SITE_URL);
function checkmobile(){
$uamatches = array("iPhone", "Trident", "iPod", "midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "Blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto", "palm", "android", "series60");
foreach($uamatches as $uastring)
if(strpos($_SERVER['HTTP_USER_AGENT'], $uastring) !== FALSE) return true;
return false;
}
?>
Please if possilbe reply me at umer@impression.me.uk
Many Thanks,
Kaleem Umer