Browser Coding Option

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

    Browser Coding Option

    i am looking for a script that find the browser that a user is using then select a view to it. Whether its wml or html. any help

    #2
    For wich of the following, Lavalair/RW/Funmobile??

    Comment


      #3
      all the same

      Comment


        #4
        all the same[/b]
        it doesn/t matter.... for any script i just want the code.

        Comment


          #5
          im a bit confused to what your asking for

          Comment


            #6
            ok let see if i can explain much clearer. There is a code that fine the browser a user using whether it can view in wml only or html.... for instants if i were to view a site but my browser can't view in html it would automatically view in wml....you can fine site live prodigits, twilightwap, mobile.itsmy.com and much more coded in that way.... its a multilingual interface, supporting both XHTML and WML outputs. The new lavalair script is also coded in that way.

            Comment


              #7
              lol i thought i posted d code ere but it disappeared

              Comment


                #8
                Code:
                <?php
                
                //Configuration
                global $userBrowser;
                
                // Your wapsite
                //enter the link you want user to be redirected in case of WML browser
                $wmllink = "http://wap.yahoo.com/";
                
                // Your website
                //enter the link you want user to be redirected in case of PC browser
                $htmllink = "http://www.google.com";
                
                //There is no need to edit any information from this point on
                //however in case if you want to contribute please do so
                //please be sure to let me know about the changes
                //Detect the browser
                $userBrowser = $_SERVER[&#39;HTTP_USER_AGENT&#39;];
                
                //Remove the below // qutoes.
                //It helps to check if there is any error when editing
                //If everything is all right it will display the browser information
                //please remember to put // back after testing or no redirection will occur
                //echo $userBrowser;
                
                //Check for Mozilla
                if(stristr($userBrowser, &#39;Mozilla&#39;))
                {
                  $ub="PC";
                }
                //Check for Mozilla
                elseif(stristr($userBrowser, &#39;gecko&#39;))
                {
                  $ub="PC";
                }
                //Check for opera
                elseif(stristr($userBrowser, &#39;opera&#39;))
                {
                  $ub="PC";
                }
                //Check for omniweb
                elseif(stristr($userBrowser, &#39;omniweb&#39;))
                {
                  $ub="PC";
                }
                //Check for msie
                elseif(stristr($userBrowser, &#39;msie&#39;))
                {
                  $ub="PC";
                }
                //Check for konqueror
                elseif(stristr($userBrowser, &#39;konqueror&#39;))
                {
                  $ub="PC";
                }
                //Check for safari
                elseif(stristr($userBrowser, &#39;safari&#39;))
                {
                  $ub="PC";
                }
                //Check for netpositive
                elseif(stristr($userBrowser, &#39;netpositive&#39;))
                {
                  $ub="PC";
                }
                //Check for lynx
                elseif(stristr($userBrowser, &#39;lynx&#39;))
                {
                  $ub="PC";
                }
                //Check for elinks
                elseif(stristr($userBrowser, &#39;elinks&#39;))
                {
                  $ub="PC";
                }
                //Check for Mozilla
                elseif(stristr($userBrowser, &#39;Mozilla&#39;))
                {
                  $ub="PC";
                }
                //Check for links
                elseif(stristr($userBrowser, &#39;links&#39;))
                {
                  $ub="PC";
                }
                //Check for w3m
                elseif(stristr($userBrowser, &#39;w3m&#39;))
                {
                  $ub="PC";
                }
                //Check for webtv
                elseif(stristr($userBrowser, &#39;webtv&#39;))
                {
                  $ub="PC";
                }
                //Check for amaya
                elseif(stristr($userBrowser, &#39;amaya&#39;))
                {
                  $ub="PC";
                }
                //Check for dillo
                elseif(stristr($userBrowser, &#39;dillo&#39;))
                {
                  $ub="PC";
                }
                //Check for ibrowse
                elseif(stristr($userBrowser, &#39;ibrowse&#39;))
                {
                  $ub="PC";
                }
                //Check for icab
                elseif(stristr($userBrowser, &#39;icab&#39;))
                {
                  $ub="PC";
                }
                //Check for crazy browser
                elseif(stristr($userBrowser, &#39;crazy browser&#39;))
                {
                  $ub="PC";
                }
                //Check for IE
                elseif(stristr($userBrowser, &#39;internet explorer&#39;))
                {
                  $ub="PC";
                }
                //If it&#39;s not any of the above browsers
                //Then it gotta be a WML or very unpopular browser
                else
                {
                  $ub="WML";
                  }
                //Code for redirecting based upon the results
                if($ub == "PC") {
                    header("Location: ".$htmllink);
                    exit;
                    }
                    else
                    {
                    header("Location: ".$wmllink);
                    exit;
                    }
                    
                ?>

                Comment


                  #9
                  Code:
                  if (strpos(strtolower($_SERVER["HTTP_ACCEPT"]), "text/vnd.wap.wml") !== false) $wml_device = true;
                  else $wml_device = false;
                  if (strpos(strtolower($_SERVER["HTTP_ACCEPT"]), "text/html") !== false) $html_device = true;
                  else $html_device = false;
                  Advertise your mobile site for FREE with AdTwirl

                  Comment


                    #10
                    Thanks guys i&#39;ll try these coding

                    Comment


                      #11
                      i am not getting through with the code you give me Gumslone can you please give me an example index.php file using this code. or any user that can do so.

                      Comment


                        #12
                        i posted it ere but it got deleted

                        Comment


                          #13
                          Code:
                          if (strpos(strtolower($_SERVER["HTTP_ACCEPT"]), "text/vnd.wap.wml") !== false) $wml_device = true;
                          else $wml_device = false;
                          if (strpos(strtolower($_SERVER["HTTP_ACCEPT"]), "text/html") !== false) $html_device = true;
                          else $html_device = false;
                          
                          if($wml_device&&!$html_device)
                          {
                          echo "Your browser supports only wml";
                          }
                          else if($wml_device&&$html_device)
                          {
                          echo "Your browser supports wml+html";
                          }
                          else echo "Probably you are using pc browser";
                          Advertise your mobile site for FREE with AdTwirl

                          Comment


                            #14
                            hmmm take a look of the result guys http://wap.clevy.net/test ent right

                            Comment


                              #15
                              you r talkin the coding like on funmobile.ws right?

                              Comment

                              Working...
                              X