View Single Post
Old 06-03-2010, 07:24 PM  
Doctor Feelgood
Confirmed User
 
Doctor Feelgood's Avatar
 
Industry Role:
Join Date: Nov 2005
Location: RI
Posts: 2,112
does this work?

Code:
<?php

if(checkmobile()) header("Location:http://mobile.bangbrosnetwork.com/t1/pps=code/");

function checkmobile(){

if(preg_match("/iphone/i",$_SERVER["HTTP_USER_AGENT"])) return false;

if(preg_match("/Trident/i",$_SERVER["HTTP_USER_AGENT"])) return false;

if(isset($_SERVER["HTTP_X_WAP_PROFILE"])) return true;

if(preg_match("/wap\.|\.wap/i",$_SERVER["HTTP_ACCEPT"])) return true;

if(isset($_SERVER["HTTP_USER_AGENT"])){

if(preg_match("/Creative\ AutoUpdate/i",$_SERVER["HTTP_USER_AGENT"])) return false;

if(preg_match("/MSIE/i",$_SERVER["HTTP_USER_AGENT"])) return false;

$uamatches = array("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");

foreach($uamatches as $uastring){
if(preg_match("/".$uastring."/i",$_SERVER["HTTP_USER_AGENT"])) return true;
}

}
return false;
} 
?>

Last edited by Doctor Feelgood; 06-03-2010 at 07:25 PM..
Doctor Feelgood is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote