You are on page 1of 1

java file <script type="text/javascript"> width = screen.width; height = screen.height; if (width > 0 && height >0) { window.location.href = "http://localhost/main.php?

width=" + width + "&height =" + height; } else exit(); </script>

main.php

file

<?php echo "<h1>Screen Resolution:</h1>"; echo "Width : ".$_GET['width']."<br>"; echo "Height : ".$_GET['height']."<br>"; ?>

http://www.webcheatsheet.com/PHP/passing_javascript_variables_php.php

You might also like