PHP Screen Resolution


Change the window and than click twice here



Sourcecode

<?PHP session_start(); ?>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>PHP Sreen Resolution</title>
<script type='text/javascript'>
function setresolutioncookie() { 
	document.cookie = "screenresolution=" + window.screen.width + "|" + window.screen.height
	+ "|" + window.screen.availWidth + "|" + window.screen.availHeight
	+ "|" + window.outerWidth + "|" + window.outerHeight
	+ "|" + window.innerWidth + "|" + window.innerHeight
	+ "|" + window.devicePixelRatio + ";"
	document.cookie = "platform=" + navigator.platform + ";" 
}
</script> 
</head>
<body onload="setresolutioncookie()">

<?php

echo '<div align="center">
<h1>PHP Screen Resolution</h1>
<table border="1" cellspacing="2" width="60%">
<form method="post">';

if (isset($_COOKIE["screenresolution"])) {
	list($window_screen_width, $window_screen_height,
	$window_screen_availWidth, $window_screen_availHeight,
	$window_outerWidth, $window_outerHeight,
	$window_innerWidth, $window_innerHeight,
	$window_devicePixelRatio) = explode("|", $_COOKIE["screenresolution"]);

	echo '<tr><td>window.screen.width</td><td>'.$window_screen_width.' px</td></tr>';
	echo '<tr><td>window.screen.height</td><td>'.$window_screen_height.' px</td></tr>';
	echo '<tr><td>window.screen.availWidth</td><td>'.$window_screen_availWidth.' px</td></tr>';
	echo '<tr><td>window.screen.availHeight</td><td>'.$window_screen_availHeight.' px</td></tr>';
	echo '<tr><td>window.outerWidth</td><td>'.$window_outerWidth.' px</td></tr>';
	echo '<tr><td>window.outerHeight</td><td>'.$window_outerHeight.' px</td></tr>';
	echo '<tr><td>window.innerWidth</td><td>'.$window_innerWidth.' px</td></tr>';
	echo '<tr><td>window.innerHeight</td><td>'.$window_innerHeight.' px</td></tr>';
	echo '<tr><td>window.devicePixelRatio</td><td>'.$window_devicePixelRatio.'</td></tr>';
}

if (isset($_COOKIE["platform"])) {
	echo '<tr><td>platform</td><td>'.$_COOKIE["platform"].'</td></tr>';
}

echo '</table>
<br>Change the window and than click twice here 
<input id="reload" type="submit" name="reload" value="Reload website">
</form></div>
<br><br><div align="left"><hr><h1>Sourcecode</h1>
<pre><code class="language-php">'.htmlentities(file_get_contents("index.php")).'</code></pre>
<hr></div>';

?>