I thought to share with you the code that detects real user agent Demo: www.tinytop.mobi
Detect Real User Agent (Original Code)
Collapse
X
-
Is tabulated with phpdesignerLast edited by kiss; 08.02.12, 15:06.www.inbuzunar.mobi - Your mobile portal pocket
Comment
-
It works with me after I changed my browser identification on my blackberry to to mozilla ?????
FAKE: Mozilla/5.0 (BlackBerry; U; BlackBerry 9780; en) AppleWebKit/534.8+ (KHTML, like Gecko) Version/6.0.0.546 Mobile Safari/534.8+ (code update - 02.02.2012, 02.02 Ro)
REAL: BlackBerry 9780My site: http://mimobifunclub.tk
sigpic
Comment
-
maybe this code will detect real ua.
Code:<?php $real=$_SERVER['HTTP_X_OPERAMINI_PHONE_UA']; $real = strtok($real, "/"); $brow = $_SERVER['HTTP_USER_AGENT']; $brow = strtok($brow, "/"); if (isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])){ $ua = $real; } else { $ua = $brow; }
Last edited by gorillaz; 16.02.12, 14:50.
Comment
-
It's Mine. Just a few code.
PHP Code:function getoribrowser($_mob_browser){
if(preg_match('/(google|bot)/i',strtolower($_mob_browser))){
$position = strpos(strtolower($_mob_browser),"bot");
$_mob_browser = substr($_mob_browser, $position-30, $position+2);
$_browser = explode (" ", $_mob_browser);
$_browser = array_reverse($_browser);
}else if (isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA'])) {
$_mob_browser = $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'];
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}else {
$_position=strpos(strtolower($_mob_browser),"nokia");
if($_position)$_mob_browser = substr($_mob_browser, $_position,25);
$_browser = explode ("/", $_mob_browser);
}
return $_browser[0];
}
Last edited by m4ster_v4; 25.02.12, 12:16.sigpic
Visit my WEBSITE Project: http://www.aspirewap.net
Comment
-
-
Ohhh, why you post offtopic? Don't ask why the code it write in some way, download & use it..if you know how :Dwww.inbuzunar.mobi - Your mobile portal pocket
Comment
-
Final update with major changes, enjoy the best user agent detector www.tinytop.mobiwww.inbuzunar.mobi - Your mobile portal pocket
Comment
Comment