Corect User Agent

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Corect User Agent

    okay heres the thing, sumwhr around here Gumslone posted this code
    Code:
    function mobile_phone($_mob_ua)
    {
          $_position=strpos($_mob_ua,"Nokia");
           if($_position)$_mob_ua = substr($_mob_ua, $_position,25);
           else $_mob_ua=$_mob_ua;
          $phone = explode ('/', $_mob_ua); 
          return $phone[0];
    }
    it shows users actualy phone model if they come at site with browsers tht shown as mozila...

    4 my needs i corected it a lil bit
    Code:
    function mobile_phone($_mob_ua)
    {
          $_position=strpos($_mob_ua,"Nokia");
           if($_position)$_mob_ua = substr($_mob_ua, $_position,25);
           else $_mob_ua=$_mob_ua;
          $phone = $_mob_ua; 
          return $phone;
    }
    (its the same, it just shows detailed browser)
    and
    it works!!!!!! im using Opera 8.65 and it shows tht my browser is nokia n80 (before - mozila)

    but why if i browsing with opera mini it still shows freakin opera and not nokia n80????????????????????????????????

    is it posible 2 make it show phn model when u browsing with opera mini?????????????
    sigpiceeeeerrr....

    #2
    okay heres the thing, sumwhr around here Gumslone posted this code
    Code:
    function mobile_phone($_mob_ua)
    {
          $_position=strpos($_mob_ua,"Nokia");
           if($_position)$_mob_ua = substr($_mob_ua, $_position,25);
           else $_mob_ua=$_mob_ua;
          $phone = explode ('/', $_mob_ua); 
          return $phone[0];
    }
    it shows users actualy phone model if they come at site with browsers tht shown as mozila...

    4 my needs i corected it a lil bit
    Code:
    function mobile_phone($_mob_ua)
    {
          $_position=strpos($_mob_ua,"Nokia");
           if($_position)$_mob_ua = substr($_mob_ua, $_position,25);
           else $_mob_ua=$_mob_ua;
          $phone = $_mob_ua; 
          return $phone;
    }
    (its the same, it just shows detailed browser)
    and
    it works!!!!!! im using Opera 8.65 and it shows tht my browser is nokia n80 (before - mozila)

    but why if i browsing with opera mini it still shows freakin opera and not nokia n80????????????????????????????????

    is it posible 2 make it show phn model when u browsing with opera mini?????????????[/b]
    ////////////////////////////////////////////
    in every file you have this code:
    $brws = explode(" ",$HTTP_USER_AGENT);
    $ubr = $brws[0];
    change it whit this and you get your answer:
    $brws = $HTTP_USER_AGENT;
    $ubr = $brws;
    good luck
    /////////////////////////////////
    www.inbuzunar.mobi - Your mobile portal pocket

    Comment


      #3
      ugh but then ill get looooooooooooooooooong browser as hell....

      it will take half of page lol and if i came with opera 8.65 it will show mozilla and nt nokia n80
      sigpiceeeeerrr....

      Comment


        #4
        lol i found it... HTTP_X_OPERAMINI_PHONE and HTTP_X_OPERAMINI_PHONE_UA i tried and it shows my corect user agent... N80-1 nd nt opera
        sigpiceeeeerrr....

        Comment

        Working...
        X