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 ...