How To Get Screen Resolution Show Screen Size Script With Php Javascript Sample Demo



How To Get Screen Resolution Show Screen Size Script With Php Javascript Sample Demo
 (328) Domains for just $1.99 1751586
How To Get Screen Resolution Show Screen Size Script With Php Javascript Sample Demo
Post Description:
Post Tags: how, to, get, screen, resolution, show, screen, size, script, with, php, javascript, sample, demo
This Post Has Been Viewed 4113 Times Since Thu May 17, 2007 10:32 am Posted By hostman with 2 replies
How To Get Screen Resolution Show Screen Size Script With Php Javascript Sample Demo
if you want to get your visitor's or users screen resolution. sometimes it helps to know about your users to customize software applications to make their expirience more enjoyable. with wallpapers, getting the user's screen resolution is very important in determining the needs of your visitors.

well, with php, you can get and show the screen resolution by using javascript.

the javascript code:
lt;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

location = 'test.php';
}
//-->
</script>


the code:
<?php
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_res = $HTTP_COOKIE_VARS["users_resolution"];


if you want to put it all together, i have created a complete hmtl demo. all you have to do is copy and paste code below into notepade, then save it as wallpaperama.php and upload to your php website, then open it with your browser and it will show you what YOUR screen resolution is.

The Complete Page
<HTML>
<TITLE>Show Screen Resolution</TITLE>
<HEAD>
<?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

location = 'wallpaperama.php';
}
//-->
</script>
<?
}
?>
</HEAD>
<BODY>
<h1>Screen Resolution by Wallpaperama.com </h1><hr>
<p>This script will show you what your screen resolution is set to using php and javascript.</p>
<p style="color:#FF0000"><?php
echo "Your Screen resolution is set at ". $screen_res;
?>
</p>
<p>If you found this script helpful, we would appreciate a link to wallpaperama.com ? Why link to us. by linking to wallpaperama.com you will help others find this free script and others in our library. </p>
<p>Thanks</p>
<p>Wallpaperama Team</p>
<p align="center">PHP Hosting Provided By <a href="http://www.webune.com">Webune.com</a> </p>
</BODY>
</HTML>

Leave Your Comments     [ dejar commentarios ]
  * Name     [nombre]

  * eMail (will not be published)     [coreo electronico]

* Enter Your Reply or Comments:    [commentarios]


Add Picture To Comments         [incluir foto]
YES NO             upload
Receive Replies on my Comments (An email will be sent to you when someone replies to your comments)

     

Comments and replies About How To Get Screen Resolution Show Screen Size Script With Php Javascript Sample Demo




:: 1 :: #4005 - Reply By guides On Mon May 21, 2007 8:24 pm
thanks, this is a good how to find screen resolution using php tutorial guide.
:: 2 :: #52127 - Reply By Lucie On Tue Apr 29, 2008 6:44 pm
great code, it worked fine, thank you