How to use js to get the width and height of the screen and pass to PHP?
PHP:
<?php
if (isset($_GET['width']) && isset($_GET['height'])) {
echo "width".$_GET['width']." ";
echo "height ".$_GET['height'];
} else {
echo '<scpt type="text/javascript">';
echo 'location.href="';
echo $_SERVER['SCRIPT_NAME'].'?'.$_SERVER['QUERY_STRING'];
echo '&width=" + screen.width + "&height=" + screen.height'."\n";
echo "</scpt>\n";
die();
}
?>