You can use JS to detect window size
(http://www.quirksmode.org/viewport/compatibility.html) and store
information in a cookie using JS. On next page request you can read
cookie in PHP. It is more probable that user has enabled cookies than
Ajax-supporting browser.