Get Visitors Screen Size Php
get visitors screen size php
get, visitors, screen, size, php
Get Visitors Screen Size Php
Post Description: get visitors screen size php
POST# 1134
Posted On: Fri Apr 11, 2008 1:29 pm
screen sise
Topic: Get Visitors Screen Size Php
is there a way to get the screen size of a visitor using php

my buddy told me its possible but i dont know if he's telling the truth

i know you can do it with javascript but i want to be able to get that information on server size instead of client side

if you know this. please tell me

im writing this php script and it would really help if you can tell me


Fri Apr 11, 2008 1:35 pm
1
hostman
Reply #1866
yes you can do it with php

here is a scrip we wrote to show you

just copy and past this code into a notepad and save it as webune-screensize.php and upload to your website and open it with your browser

<HTML>
<TITLE>Getting User's Screen Resolutions with PHP Script Code Sample Example</TITLE>
<HEAD>
<?
######## __________________________ ###########
######## SCRIPT BY WEBUNE.COM #################
######## PLEASE DO NOT REMOVE THIS ############
######## __________________________ ###########

if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_resolution = $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, 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;
document.cookie=the_cookie

location = 'show-user-screen-resolution-php.php.php';
}
//-->
</script>
<?
}
?>
</HEAD>
<style type="text/css">
<!--
.style1 {color: #0000FF}
.style2 {color: #0066FF}
.style3 {color: #CC0000}
-->
</style>
<BODY>
<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="http://www.wallpaperama.com">Wallpaperama.com</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

class="style3">&quot;users_resolution&quot;</span>])</p>
<p><a href="http://www.wallpaperama.com/">&lt;&lt; Go Back</a> </p>
<p align="center">PHP Hosting by <a href="http://www.webune.com">Webune.com</a> </p>
<p>
</BODY>
</HTML>

What do you think?

* name:  

* email:  

* Please enter comments:


Receive Replies on my Comments
(An email will be sent to you when someone replies to your comments)

Add image to comments
yes no             upload