Passare variabili Javascript a PHP: Difference between revisions
Jump to navigation
Jump to search
m New page: Javascript: <pre> <script type="text/javascript"> width = screen.width; height = screen.height; if (width > 0 && height >0) { window.location.href = "http://localhost/main.php?width=... |
(No difference)
|
Latest revision as of 17:40, 23 July 2009
Javascript:
<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>
PHP:
<?php echo "<h1>Screen Resolution:</h1>"; echo "Width : " . $_GET['width'] . "<br>"; echo "Height : " . $_GET['height'] . "<br>"; ?>