originally copy from : http://www.go4expert.com/forums/showthread.php?t=7979 The best possible solution is <script language="javascript"> if (window.location.search == "") { window.location.href = window.location + "?width=" + screen.width + "&height=" + screen.height; } </script> Then create a file called screen.php and use this: <?php $width = $_get['width']; $height = $_get['height']; echo "You are using a $width x $height screen resolution"; // And set them into cookies as well. ?> PHP: i have little knowledge about php . can any body explain this code . i already copy paste this code but get error like but in browser window : You are using a x screen resolution in URL bar : http://localhost/scr/screen.php?width=1280&height=1024 actually i want Screen resolution of User in PHP.is there any simple method for this (php) thanks
I think this should work now, but I haven't tested it. //I'm assuming this is a separate page, so i changed a little of it. <html> <head> <script language="javascript"> window.location = "screen.php?width=" + screen.width + "&height=" + screen.height; } </script> </head> </html> Code (markup): <?php session_start(); $width = $_get['width']; $height = $_get['height']; setcookie('width',$width); setcookie('height',$height); echo "You are using a $width x $height screen resolution"; // And set them into cookies as well (done with setcookie()) ?> Code (markup): viola!
no success !!! by the way i get perfect solution http://www.wallpaperama.com/forums/how-to-get-screen-resolution-show-screen-size-script-with-php-javascript-sample-demo-t1351.html