how to get user's screen resolution with PHP

Moon picture Moon · Nov 14, 2010 · Viewed 90k times · Source

Possible Duplicate:
Getting the screen resolution using PHP

well the question is self explanatory

where i want to reach is

$width = ; //user screen width in here

F1! F1!

Answer

Matt Ball picture Matt Ball · Nov 14, 2010

You need JavaScript, not PHP.

var screenWidth = window.screen.width,
    screenHeight = window.screen.height;

You can then send it to the server via Ajax (with an XmlHttpRequest).

See also the MDC window.screen docs.