One way to find a user's screen resolution with php is with the $HTTP_COOKIE_VARS function.

This post tutorial guide will show you how to retrieve, get, show, display, find your weg page (site) visitors screen resolution.

NOTE: for this function to work, you will need to have PHP, if you don't have PHP on your website, we recommend our friends at for PHP hosting. check them out.

the first thing to do is to copy and past this sample code into your editor, you can use notepad it you like:

<TITLE>Getting User's Screen Resolutions with PHP Script Code Sample Example</TITLE>
   $screen_resolution = $HTTP_COOKIE_VARS["users_resolution"];
else //means cookie is not found set it using Javascript
<script language="javascript">

function writeCookie()
 var today = new Date();
 var the_date = new Date("December 31, 2010");
 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;
 location = 'show-user-screen-resolution-php.php';
<style type="text/css">
.style1 {color: #0000FF}
.style2 {color: #0066FF}
.style3 {color: #CC0000}
<h1 align="center" class="style2"><strong>Your Screen Resolutions is set to:</strong> <?php echo $screen_resolution; ?></h1>
<div align="center">Turotial by <a href=""></a></div>
<hr size="2" noshade>
<p>Hello and Welcome to this Wallpaperama &quot;Get User's Screen Resolution&quot; Script.</p>
<p>As webmaster, we often need to get the user's screen resolution to make our visitor's expirience more enjoyable and fun.</p>
<p>One way wallpaperama has implemented this, is to customize specific webpages to our visitors depending on the computer screen resolution

setting or properties.</p>
<p>The PHP function to do this is: <span class="style1">isset</span>(<span class="style2">$HTTP_COOKIE_VARS</span>[<span

<p><a href="">&lt;&lt; Go Back</a> </p>
<p align="center">PHP Hosting by <a href=""></a> </p>

now save it as show-user-screen-resolution-php.php and upload it to your website.

after you have uploaded to your website, open the file with your browser (example:

after you have opened it, you will see your own screen resolution display on the screen.

Our friends at have provided us with free hosting to demonstrate how this script works.

NOTE: you will require to be hosted on a site that has PHP. If you need PHP web hosting, has great PHP packages available, I recommend them cuz i am very happy with them than from my previous web host provider.