User-Agent Behind Opera Mini

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

    User-Agent Behind Opera Mini

    Blah blah, might be useful.
    Code:
    function userAgnt(){
    $str = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
     if(stristr('Opera Mini',$str)){
     $str = isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : '';
     }
    return mysql_real_escape_string($str);
    }
    Last edited by CreativityKills; 14.08.09, 08:47.

    #2
    What the usefulness of this script?
    Wait...
    sigpic

    Comment


      #3
      To tell you what phone they are using behind opera mini*

      Comment


        #4
        Originally posted by mobilegigs View Post
        blah blah, might be useful.
        Code:
        function useragnt(){
        $str = isset($_server['http_user_agent']) ? $_server['http_user_agent'] : '';
         if(stristr('opera mini',$str)){
         $str = isset($_server['http_x_operamini_phone_ua']) ? $_server['http_x_operamini_phone_ua'] : '';
         }
        return mysql_real_escape_string($str);
        }
        not working
        Wait...
        sigpic

        Comment


          #5
          maybe helpfull

          HTML Code:
          echo browser_agent($_SERVER["HTTP_USER_AGENT"]);
          
          function browser_agent($_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];
          }

          Comment


            #6
            Originally posted by malaysiawap View Post
            maybe helpfull

            HTML Code:
            echo browser_agent($_SERVER["HTTP_USER_AGENT"]);
            
            function browser_agent($_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];
            }
            yes. this is workable. it was posted here first by gumslone very ago.
            thanks.
            Wait...
            sigpic

            Comment


              #7
              more usefull but well know headers

              x-operamini-features:

              Header added by the Opera Mini proxy. Values are "advanced, download, camera, folding, inputhints"

              x-operamini-phone:

              The phone name provided by the Opera Mini proxy.

              x-operamini-phone-ua:

              The original user-agent of the device using a Opera Mini browser

              x-original-user-agent:

              Googles transcoders way to pass the device' user agent to the server.

              Comment


                #8
                Tankyou malasyawap for your code. This code workable. More im the problem using this code. What acess usingned the browser real my (sony ericsson w610i) not apear in agente. What code im use to cocert this?

                Comment


                  #9
                  Where i put this code plz tel me.

                  Comment


                    #10
                    In which file i put this code plz tel me.

                    Comment


                      #11
                      in which file should put the code on index.php?

                      Comment


                        #12
                        Originally posted by mobileGIGS View Post
                        Blah blah, might be useful.
                        Code:
                        function userAgnt(){
                        $str = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
                         if(stristr('Opera Mini',$str)){
                         $str = isset($_SERVER['HTTP_X_OPERAMINI_PHONE_UA']) ? $_SERVER['HTTP_X_OPERAMINI_PHONE_UA'] : '';
                         }
                        return mysql_real_escape_string($str);
                        }
                        this code goes to core.php create database in user table to store the out put of the code and create a usage in login.php or index.php to update user in his/her real browser behind operamini .Just a idea.

                        Comment

                        Working...
                        X