Hi all, i want to get the maximum width and height of the screen. could anyone telll me the right coding for this
Get maximium width and height of the screen
Collapse
X
-
Tags: None
-
yes you are right we can't do in php use javascript
check the below code
part1-javascript
[HTML]<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>
[/HTML]
part-2 php (main.php)
[PHP]
<?php
echo "<h1>Screen Resolution:</h1>";
echo "Width : ".$_GET['width']."<br>";
echo "Height : ".$_GET['height']."<br>";
?>[/PHP]
I hope this would solve the problemComment
-
Comment