Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get user's screen resolution with PHP [duplicate]

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!

like image 518
Moon Avatar asked Nov 14 '10 22:11

Moon


2 Answers

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.

like image 155
Matt Ball Avatar answered Sep 28 '22 07:09

Matt Ball


You can't, not in php. PHP is strictly server-side.

like image 40
Femaref Avatar answered Sep 28 '22 06:09

Femaref