Pls help me , how to Short browser

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

    Pls help me , how to Short browser

    hello frnd. how to short a browser in script Mobile chat wml ? help me guys. i need ur help huys. give me the code.

    #2
    short means what do you mean ?

    Comment


      #3
      i want 15 maxlength browser . i've no idea if users joined use 100 letters in the browser. pls give me the code bro ...

      Comment


        #4
        Originally posted by weet2012 View Post
        i want 15 maxlength browser . i've no idea if users joined use 100 letters in the browser. pls give me the code bro ...
        Limit the Length of the mysql field for browser to 15 characters bro...

        Or try this,

        PHP Code:
        $browser  $_SERVER['HTTP_USER_AGENT'];

        $browser substr($browser015);  // will return the first 15 characters from the browser

        // then do your stuff here 


        I'm Proud to be a Sri Lankan!

        Comment


          #5
          List a little this subforum.

          Snippets, Functions and Classes
          <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

          Comment


            #6
            where im holding the code bro ?

            Comment


              #7
              Originally posted by weet2012 View Post
              where im holding the code bro ?
              Where you show the browser name...........But Limiting it with that way might end up with a ugly result like half of the words etc..rather it is good if u use a function like explode and break the names u need....


              I'm Proud to be a Sri Lankan!

              Comment


                #8
                i dont know what your trying to accomplish. but it makes no sense what so ever.

                my script already cuts down the browser name to names like.

                PHP Code:
                $user explode ('/'$_SERVER['HTTP_USER_AGENT']);
                echo 
                $user[0]; 
                opera
                mozilla
                chrome
                safari
                etc etc.

                and the users themselfs cannot modify the outcome of this result.
                so i see this as a futial attempt at coding something that doesnt need fixing.

                but each to their own.
                <?php
                include ('Ghost');
                if ($Post == true) {
                echo '

                sigpic
                alt='coding-talk.com!!' />';
                echo 'Sharing Is Caring!';
                } else {
                echo '

                alt='the username GHOST has been comprimised!' />';
                echo 'OMG SOMEBODY HELP ME!!';
                }
                ?>

                Comment


                  #9
                  Actualy they can and usualy do because UA is user input.
                  And by that, what if there isn't / slash in it...
                  <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                  Comment


                    #10
                    well ive never come across a situation where the user has been able to modify the outcome of what his browser name displays at, but ill take your word for it.

                    and your solution would be to do what?
                    <?php
                    include ('Ghost');
                    if ($Post == true) {
                    echo '

                    sigpic
                    alt='coding-talk.com!!' />';
                    echo 'Sharing Is Caring!';
                    } else {
                    echo '

                    alt='the username GHOST has been comprimised!' />';
                    echo 'OMG SOMEBODY HELP ME!!';
                    }
                    ?>

                    Comment


                      #11
                      Trust me. One of solutions is this.
                      <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                      Comment


                        #12
                        well thats given me something to think about at least.
                        although that snippet seems like alot of work just to grab a browser name and dump it into a .txt file.
                        wether its a temp dump or a permenent one.

                        but thanks though.
                        <?php
                        include ('Ghost');
                        if ($Post == true) {
                        echo '

                        sigpic
                        alt='coding-talk.com!!' />';
                        echo 'Sharing Is Caring!';
                        } else {
                        echo '

                        alt='the username GHOST has been comprimised!' />';
                        echo 'OMG SOMEBODY HELP ME!!';
                        }
                        ?>

                        Comment


                          #13
                          Welcome. ;) But i think that everything less than that is meaningless, for it structure as it covers check for empty server var, it can be isset but with no value, and sets the word Browser if is, checks if there is / slash and if not sends it to check and cut if its longer that 10 chars, if is / slash there it goes to see what there is, as for browser reading many of phones is gonna display Mozilla even when it totally different models, not to mention manufactors, here is covered Nokia phones not to display Mozilla when its Nokia or if in first string is model to display, for example, NokiaN97, not Nokia. Similar goes for IEMobile and Android...
                          So, that function can only be extended, and plus better over strstr() as it uses strpos() is faster and clearly faster than regex and preg_match(). ;)
                          <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

                          Comment


                            #14
                            Well...Actually browser is a user input as I see....and of course user can change the browser name showing...there are many proxies which can do that..

                            I think it is better to use explode function like this.

                            PHP Code:
                            $user explode (" "$_SERVER['HTTP_USER_AGENT']); 
                            now dont tell if his bowser has no spaces, haha. If there is a browser name like that which has no spaces. then use the function I mentoned in the above post which will get the first 15 characters of the browsr name.


                            I'm Proud to be a Sri Lankan!

                            Comment

                            Working...
                            X