| | A quick question for all you coders. I'm looking for a way to autodetect a viewer's screen resolution without using javascript (as some people have it disabled). Is there any way to do this via a purely server side function, e.g. php? Thanks. |
|
|
Well till where i know this is impossible.
Also if the user has no javascript request them to switch it on. But why do you need PHP to do this work because it is Server side while Javascript is Client side.
It is impossible for PHP to detect the size of the browser window. PHP is run on the web server and outputs the results of the functions you tell it to run as HTML code, no PHP ever reaches the client browser. You will need a client-side scripting language, one run on the viewer's browser, so that it can detect what is happening on their PC. All client side scripts can be disabled though, so you won't avoid that problem.
Why do you need to detect the browser size anyway? If it's for a layout surely you can use some CSS tricks to achieve the same? It may not look that pretty but people can't disable it and they very rarely read through your CSS. It is impossible for PHP to detect the size of the browser window. PHP is run on the web server and outputs the results of the functions you tell it to run as HTML code, no PHP ever reaches the client browser. You will need a client-side scripting language, one run on the viewer's browser, so that it can detect what is happening on their PC. All client side scripts can be disabled though, so you won't avoid that problem. Why do you need to detect the browser size anyway? If it's for a layout surely you can use some CSS tricks to achieve the same? It may not look that pretty but people can't disable it and they very rarely read through your CSS. I didn't think there was a way, but I figured I mind as well ask.
Recent Queries:-
Keywords : php, resolution, detection, js
Looking for php, resolution, detection, js
|
|
![]() Php Resolution Detection? - Is it possible to do without using JS? |
| ADD REPLY / Got an Opinion! | a humble request :-) | RAPID SEARCH! | Free Hosting | [X] |
|
Express your Opinions, Thoughts or Contribute more info. to help others. Ask your Doubts & Queries to get answers, So that "Together We can help others!" |
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP. | 500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE |
|