PHP Get the client computer screen parameters method, get screen parameters _php tutorial

Source: Internet
Author: User
Tags php server

PHP Get the client computer screen parameters method, get screen parameters


The example in this paper describes how PHP gets the client computer screen parameters. Share to everyone for your reference. The specific analysis is as follows:

The first thing to note is that PHP is the server-side language and is not getting the width and height of the client's screen. However, the workaround is to get the client's computer screen width and height through the client-side scripting language JavaScript, and then pass it to the PHP scripting language in the form of Ajax or cookies, thus enabling PHP to get the width and height of the client computer screen.

The method of obtaining the width, height, and resolution of the client computer via JavaScript is as follows:

High screen resolution: Window.screen.height

Width of screen resolution: Window.screen.width

Screen available work area height: window.screen.availHeight

Screen available work area width: window.screen.availWidth

The methods passed to the PHP server are as follows:
Copy the Code code as follows: $.post (' http://localhost/php/index.php ', {w:width,h:height});//The return value is omitted here

The complete code for the width, height, and resolution of the display screen of the client computer via PHP is as follows:
Copy the Code code as follows:


Untitled Document




Here is the text ...

I hope this article is helpful to everyone's PHP programming.

http://www.bkjia.com/PHPjc/940495.html www.bkjia.com true http://www.bkjia.com/PHPjc/940495.html techarticle PHP Get the client computer screen parameters method, get screen parameters This article describes how PHP gets the client computer screen parameters. Share to everyone for your reference. A specific analysis such as ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.