detect real user agent

Started on the old forum in April 2011 · view the original in the archive · old links redirect here

19 replies · 5,822 views · started 15 years ago · 1 min read

TL;DR · summary of 19 replies
  • -GumSlone asked for a code that detects original user agents, specifically mobile ones.
  • -The thread concluded with various pieces of code being shared, but none directly addressing GumSlone's request for detecting original mobile user agents.
  • -Kiss provided an updated version of the code which includes HTTP_X_ORIGINAL_USER_AGENT, though it was not confirmed if this met GumSlone’s needs.
  • -GumSlone ultimately preferred the initial post's solution.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

10 participants
GumSlone Administrator Principal · 1,690 posts #1
function gum_real_ua()
{
//GET REAL DEVICE USER AGENT
     $keyname_ua_arr = array('HTTP_X_ORIGINAL_USER_AGENT','HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA','HTTP_X_BOLT_PHONE_UA', 'HTTP_X_MOBILE_UA', 'HTTP_USER_AGENT');
    foreach ($keyname_ua_arr as $keyname_ua) {
        if (!empty($_SERVER[$keyname_ua])) {
            return $_SERVER[$keyname_ua]; //REAL UA
            break;
        }
    }
}

Advertise your mobile site for FREE with AdTwirl

External image (may be gone)

frostymarvelous Senior · 266 posts #2

Nice. Was looking for the break, and there it was!

Perfection comes at a cost

I accept liberty!

mayurss786 Developer · 137 posts #4

hey gumslone plz share user agent script that will original user like dont spam here his user agent script will show original user agent(mobile) if any one use any browser

check this Free Call Software For Ur Opera 9.80 on dont spam here

arnage Lead · 811 posts #5
$short = explode(' ', gum_real_ua());
echo '
Free Call Software For Ur '.$short[0];
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
mayurss786 Developer · 137 posts #6

yeah thnx bro

arnage wrote:

$short = explode(' ', gum_real_ua());
echo '
Free Call Software For Ur '.$short[0];
arnage Lead · 811 posts #7

U r welcome. 😉

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
kiss Senior · 294 posts #8

I made my own code to detect the real browser 😉 Demo: http://www.whatmp3.name/real_browser.phphttp://www.tinytop.mobi/browser.php

  • Firefox X, Opera X, Chrome x, Safari X, Msie X, K-Meleon X, SeaMonkey X, Camino X, Lynx X, amaya X, Anonymouse + some bots: Google, Msn, Yahoo, Bing, Aol, DoCoMo, Baiduspider, WebCopier, Java
  • Uc Browser 5.x, 6.x, 7.x
  • Opera Mini 3.x, 4.x, 5.x, 6.x
  • Opera Mobile 10.x, 11.x
  • Opera SmartPhone 8.x
  • BoltBrowser 2.x
  • Netfront 3.x
  • portalmmm 2.x
  • Nintendo Wii

www.inbuzunar.mobi -Your mobile portal pocket

Mysterio Lead · 630 posts #9

kiss wrote: I made my own code to detect the real browser 😉 Demo: http://www.whatmp3.name/real_browser.php

  • Firefox X, Opera X, Chrome x, Safari X, Msie X, K-Meleon X, SeaMonkey X, Camino X, Lynx X, amaya X, Anonymouse + some bots: Google, Msn, Yahoo, Bing, Aol, DoCoMo, Baiduspider, WebCopier, Java
  • Uc Browser 5.x, 6.x, 7.x
  • Opera Mini 3.x, 4.x, 5.x, 6.x
  • Opera Mobile 10.x, 11.x
  • Opera SmartPhone 8.x
  • BoltBrowser 2.x
  • Netfront 3.x
  • portalmmm 2.x
  • Nintendo Wii

Good! Share?

mysterio.al - programming is a functional art

kiss Senior · 294 posts #10

If i share this code someone will sell it 🙂 like i see around internet what it's gonna happen with someone work 🙂

www.inbuzunar.mobi -Your mobile portal pocket

mayurss786 Developer · 137 posts #14

Gums user agent with random link

<?

function gum_real_ua() { //GET REAL DEVICE USER AGENT $keyname_ua_arr = array('HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA','HTTP_X_BOLT_PHONE_UA', 'HTTP_X_MOBILE_UA', 'HTTP_USER_AGENT'); foreach ($keyname_ua_arr as $keyname_ua) { if (!empty($_SERVER[$keyname_ua])) { return $_SERVER[$keyname_ua]; //REAL UA break; } } } $mayur= explode(' ', gum_real_ua()); $shona=$mayur[0]; $urls = array("http://top.sendwap.com/?id=mirchiwapin" ,"http://top.sendwap.com/?id=mirchiwapin","http://inztop.com/in.php?sid=761", "http://neti.mobi/site=mirchiwapin", "http://bestwapi.com/?id=mirchiwapin"); $text = array("Call App for", "Internet Download Manager for", "Katil Browser for", "3d Games for", "Powerfull Software for "); srand(time()); //set the number in (rand()%3); for however many links there are $random = (rand()%7); echo ("<a href = "$urls[$random]">$text[$random] $shona</a>"); ?>

try this user agent with random links

stefan998 Junior · 25 posts #18

GumSlone wrote:

function gum_real_ua()
{
//GET REAL DEVICE USER AGENT
     $keyname_ua_arr = array('HTTP_X_ORIGINAL_USER_AGENT','HTTP_X_DEVICE_USER_AGENT', 'HTTP_X_OPERAMINI_PHONE_UA','HTTP_X_BOLT_PHONE_UA', 'HTTP_X_MOBILE_UA', 'HTTP_USER_AGENT');
    foreach ($keyname_ua_arr as $keyname_ua) {
        if (!empty($_SERVER[$keyname_ua])) {
            return $_SERVER[$keyname_ua]; //REAL UA
            break;
        }
    }
}

Where to put this code

kiss Senior · 294 posts #20
 function ua()
 {
  $ua = array(
   'HTTP_DEVICE_STOCK_UA',
   'HTTP_X_DEVICE_USER_AGENT',
   'HTTP_X_ORIGINAL_USER_AGENT',
   'HTTP_X_UCBROWSER_DEVICE_UA',
   'HTTP_X_OPERAMINI_PHONE_UA',
   'HTTP_X_SKYFIRE_PHONE',
   'HTTP_X_BOLT_PHONE_UA',
   'HTTP_X_PUFFIN_UA',
   'HTTP_X_MOBILE_UA',
   'HTTP_X_SCANNER',
   'HTTP_FROM',
   'HTTP_USER_AGENT' ) ;
  foreach ( $ua as $real_ua ) {
   if ( ! empty( $_SERVER[$real_ua] ) ) {
    return $_SERVER[$real_ua] ;
    break ;
   }
  }
 }

www.inbuzunar.mobi -Your mobile portal pocket

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close