how to detect mobile screen size

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

    how to detect mobile screen size

    How can i detect the mobile users screen size using php? I know it has something to do with UA,but please anyone help me.

    #2
    try searching on Developer's Home - Tutorials and Articles for SMS, WML, WMLScript, WAP 2.0, XHTML MP, WCSS/WAP CSS i read it a while ago but dont remember a thing xD
    PHP Code:
    $("#mfreak").find(".head brain").clone(); 
    Progress:
    Code:
    [|||___________________________] : 5%
    Output:
    Code:
    Memory limit reached, unable to complete operation.
    Support answer:
    Code:
    Try using a super uber strong mega computer to reach at least 10%.

    Comment


      #3
      PHP Code:
      <script type="text/javascript">document.write(screen.width+'x'+screen.height);</script
      or visit Scripts: PHP Browser & OS Detection :: Browser specific CSS stylesheets
      www.inbuzunar.mobi - Your mobile portal pocket

      Comment


        #4
        Originally posted by Sifat3d View Post
        How can i detect the mobile users screen size using php? I know it has something to do with UA,but please anyone help me.
        google for tera wurfl or device atlas.
        Advertise your mobile site for FREE with AdTwirl

        Comment


          #5
          i want .php code for screen size detection not java script

          Comment


            #6
            PHP it self can't detect screen resolution.
            <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

            Comment


              #7
              Confusion, confusion confusion. Anyone know how to detect phone vendor and model?like if u enter my site i show u:u r using nokia 6120

              Comment


                #8
                PHP Code:
                <?php

                if(isset($HTTP_COOKIE_VARS["users_resolution"]))
                $screen_res $HTTP_COOKIE_VARS["users_resolution"];
                else 
                //means cookie is not found set it using Javascript
                {
                ?>
                <script language="javascript">
                <!--
                writeCookie();

                function writeCookie()
                {
                var today = new Date();
                var the_date = new Date("December 31, 2023");
                var the_cookie_date = the_date.toGMTString();
                var the_cookie = "users_resolution="+ screen.width +"x"+ screen.height;
                var the_cookie = the_cookie + ";expires=" + the_cookie_date;
                document.cookie=the_cookie

                }
                //-->
                </script>
                <?
                }

                echo "Your screen resolution is set at ". $screen_res;
                ?>
                ***use [ php ] tag [ / php ] for posting code***
                Last edited by metulj; 17.11.11, 06:06.

                Comment

                Working...
                X