Program | resolution | display This tutorial belongs to the original, reproduced please indicate the Web page teaching network
Today, we made a browser to display the screen resolution of the PHP code, I hope you use it, have any questions please go to the forum post discussion.
First create a new file named: resolution.php the contents of the code are as follows: ( Note: The file name extension must be. PHP is not. HTML)
<script language= "JavaScript" >
<!--
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_res=" + screen.width + "x" + screen.height;
var The_cookie = The_cookie + "; expires=" + the_cookie_date;
Document.cookie=the_cookie
Web page Teaching Network http://www.webjx.com Web Designer's Cradle!!
Next, put the following code where you want to display the visitor's display resolution information! (The following code, of course, is also placed in the extension. PHP file)
<?php
$callget_res_page_name = $request_uri;
$globals[callget_res_page_name] = $callget_res_page_name;
Include ("resolution.php");
echo $screen_width. " X ". $screen_height." Is your screen resolution. ";
?>
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.