Get visitors screen size php
- Forums
- PHP
- Get visitors screen size php
This Page Contains information about Get visitors screen size php By screen sise in category PHP with 1 Replies. [2000], Last Updated: Mon Jun 24, 2024
screen sise
Fri Apr 11, 2008
1 Comments
945 Visits
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
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
<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 "Get User's Screen Resolution" 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">"users_resolution"</span>])</p>
<p><a href="http://www.wallpaperama.com/"><< Go Back</a> </p>
<p align="center">PHP Hosting by <a href="http://www.webune.com">Webune.com</a> </p>
<p>
</BODY>
</HTML>
https://www.webune.com/forums/get-visitors-screen-size-php.html