Prob in Detecting Phon Browser

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

    Prob in Detecting Phon Browser

    Hello,
    I am using lava wml scripts.
    Lately I am facing a prob is that at times my script can't detect users mobile browser! Browser field shows empty. It means users browser data cant insert in database. why this happening? Need proper solutions or if anyone has the better browser detecting function plz post here.
    Wait...
    sigpic

    #2
    Originally posted by anderson View Post
    Hello,
    I am using lava wml scripts.
    Lately I am facing a prob is that at times my script can't detect users mobile browser! Browser field shows empty. It means users browser data cant insert in database. why this happening? Need proper solutions or if anyone has the better browser detecting function plz post here.

    PHP Code:
    function realbro($_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];

    realbro($_SERVER['HTTP_USER_AGENT'])
    Last edited by Anshul; 17.05.09, 09:00.

    Comment


      #3
      Error

      Your function shows syntax error, unexpected T_MUL_EQUAL @ anshul
      Wait...
      sigpic

      Comment


        #4
        have you tryed handsetdetection.com? it might save you some time.

        Comment


          #5
          Originally posted by anderson View Post
          Your function shows syntax error, unexpected T_MUL_EQUAL @ anshul
          that normally means it doesnt like ==
          Want something coded email me at sales@webnwaphost.com for a prices.




          Comment


            #6
            Originally posted by anderson View Post
            Hello,
            I am using lava wml scripts.
            Lately I am facing a prob is that at times my script can't detect users mobile browser! Browser field shows empty. It means users browser data cant insert in database. why this happening? Need proper solutions or if anyone has the better browser detecting function plz post here.
            put this in core.php
            PHP Code:
            function get_mob_browser($_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];

            put this where you want to update the browser, some of script put this in login.php or index.php
            PHP Code:
                        $brws explode(" ",$_SERVER[HTTP_USER_AGENT] );
                        
            $ubr get_mob_browser($brws[0]);
                        
            $uip getip();
                        
            $res mysql_query("UPDATE ibwf_users SET browserm='".$ubr."', ipadd='".$uip."' WHERE id='".getuid_sid($sid)."'"); 

            `browserm` varchar(200) NOT NULL default '',
            Last edited by kei_ki7; 04.12.09, 06:42.
            Did I help you?
            You can help me too
            Your donations will help me finance my studies.

            Comment

            Working...
            X