Created
May 6, 2014 15:24
-
-
Save xombra/731184aad7337b59edcb to your computer and use it in GitHub Desktop.
User_Agent para moviles (redireccionamiento)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$List_User_Agent = array( | |
'android' => 'android', 'AvantGo' => 'AvantGo', 'PLAYSTATION' => 'PLAYSTATION','Mobile','Mobile', | |
'BlackBerry' => 'BlackBerry', 'blazer' => 'blazer', 'hiptop' => 'hiptop', 'GoBrowser' => 'GoBrowser', | |
'Cellphone' => 'Cellphone', 'EudoraWeb' => 'EudoraWeb', 'fennec' => 'fennec', 'IEMobile' => 'IEMobile', | |
'iPhone' => 'iPhone', 'iPod' => 'iPod', 'Googlebot-Mobile' => 'Googlebot-Mobile', 'Iris' => 'Iris', | |
'iphone' => 'iphone', 'GoogleMobilizer' => 'Google Wireless Transcoder', 'KYOCERA' => 'KYOCERA', | |
'LGE' => 'LGE', 'midp' => 'midp', 'Minimo' => 'Minimo', 'NetFront' => 'NetFront', 'Dorothy' => 'Dorothy', | |
'Nintendo' => 'Nintendo', 'Nitro' => 'Nitro', 'Nokia' => 'Nokia', 'Motorola' => 'mot-', 'TeaShark' => 'TeaShark', | |
'OperaMini' => 'Opera Mini', 'Palm' => 'Palm', 'PDA' => 'PDA', 'Blazer' => 'Blazer', 'iPad' => 'iPad', | |
'BOLT' => 'BOLT', 'Fennec' => 'Fennec', 'Opera Mobi' => 'Opera Mobi', 'Series60' => 'Series60', | |
'Phone' => 'Phone', 'PIE4' => 'MSIE 4.01; Windows CE; PPC; 240x320', | |
'PIE4_Smartphone' => 'MSIE 4.01; Windows CE; Smartphone;', | |
'PIE6' => 'MSIE 6.0; Windows CE;', 'Plucker' => 'Plucker', 'PPC' => 'PPC', 'MIB' => 'MIB', | |
'PlayStation' => 'PlayStation', 'proxinet' => 'proxinet', 'Presto' => 'Presto','SHARP-TQ-GX10' => 'SHARP-TQ-GX10', | |
'SHG-i900' => 'SHG-i900', 'WCE' => 'WCE','sonyericssonp800' =>'sonyericssonp800', 'Smartphone' => 'Smartphone', | |
'SEMC' => 'SEMC', 'SonyEricsson' => 'SonyEricsson', 'symbian' => 'symbian','vodafone' => 'vodafone', | |
'webOS' => 'webOS', 'WindowsMobile' => 'Windows CE', 'WinWAP' => 'WinWAP', 'WX310K' => 'WX310K', | |
'S60' => 'S60' ); | |
function browser($lista_user_agents, $user_agents_capturado){ | |
foreach($lista_user_agents as $navegador => $user_agent_rev) { | |
if(stristr($user_agents_capturado, strtolower($user_agent_rev))!==false){ | |
return $user_agents_capturado; | |
} | |
} | |
return 'NO'; | |
} | |
if (browser($List_User_Agent,strtolower($_SERVER['HTTP_USER_AGENT']))!='NO') | |
{ if (isset($_GET["nota"])) { | |
header("location:http://sitiomovil/variables"); | |
} | |
else { | |
header('location:http://http://sitiomovil'); } | |
die(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment