View Full Version : Screen Resolution

03-16-2003, 08:29 PM
Is there a variable to tell PHP what screen resolution the client is running?

03-16-2003, 08:44 PM
PHP runs on the server. To get screen resolution you would have to use client-side javascript and then send that value to the server via either a POST or GET submission.

03-16-2003, 08:54 PM
That's no good... I hate javaScript...

03-16-2003, 11:55 PM
There's no other way besides using JavaScript...

...and having said that, I always wonder why people want to know the screen resolution. IMO that's a really uninteresting piece of information about the user's computer. What do I gain from knowing that the screen resolution is either 640 x 480 or 2860 x 1430? Nothing. It doesn't tell me anything about the size my webpage can occupy with visual content. The size of the canvas area in the browser window could be obtained via JavaScript, but hey, you can save yourself from this hassle if you chose a flexible design of your pages (that's what HTML is meant for).