Getting screen resolution in PHP is done through javascript cookie.
How it works :
1.Javascript gets the user resolution and stores in the cookie
2.We can use PHP to read that cookie.
The following code snippet gives the resolution of a browser using php and javascript. However you can also modify the code to get height and width seperately (screen.width and screen.height are the parameters for width and height respectively).
if(isset($HTTP_COOKIE_VARS["users_resolution"]))
$screen_res = $HTTP_COOKIE_VARS["users_resolution"];
else //no cookie set in Javascript
{
?>
}
?>
echo "Your Screen resolution is set at ". $screen_res;
?>
You can also get width or height alone
Code by www.dumpsquestions.com/webdeveloper
No related posts.



Dumps Questions










November 2nd, 2009 at 8:37 am
There is some problem.
November 2nd, 2009 at 8:37 am
Sitemap code has to be fixed.
July 3rd, 2010 at 6:17 pm
Nice website you have, the posts here are very useful. Thanks!
May 24th, 2011 at 11:42 am
I searched for this theme! The following code snippet gives the resolution of a browser using php and javascript.
September 7th, 2011 at 11:37 am
However you can also modify the code to get height and width seperately (screen.width and screen.height are the parameters for width and height respectively..Good Luck
September 11th, 2011 at 4:12 pm
Thanks for this post! I searched for this theme! The following code snippet gives the resolution of a browser using php and javascript.
October 8th, 2011 at 9:48 am
I think, this theme is quite actual now. I searched for this theme! The following code snippet gives the resolution of a browser using php and javascript.
November 21st, 2011 at 7:22 am
Cheap Louis Vuitton Handbags great site and funny comic
December 17th, 2011 at 7:54 am
Thanks for providing this knowledgeable information, i think most of the peoples are get benefits from your blog.
December 17th, 2011 at 9:00 am
Love reading the Post, you are doing a great job .
December 21st, 2011 at 3:11 pm
In search of the site I want to study the whole Internet and found your site – it’s just finding me! thank you that you are
December 23rd, 2011 at 10:00 am
Hi I am a big reader, would really appreciate an invite. Your blog is very nice and I really enjoy the style and content. THanks
December 30th, 2011 at 8:19 am
An interesting discussion might be priced at comment. I think that it is best to write more on that topic, it might not be considered a taboo subject but generally individuals are not enough to communicate on such topics. To the next. Cheers
December 31st, 2011 at 8:54 am
I wanted to thank you for this great guide! This is a very informative post, it help me more. and i will share my website..
January 6th, 2012 at 10:45 pm
http://www.stumbleupon.com/stumbler/business-blog