Here's an interesting challenge I've been scratching my head over for the last few days. I need to figure out some way to do a server-side check on the visitor's screen size without using ASP. And I need to do it while preserving the functionality of the back button.
Unfortunately, this rules out the ingenious Javascript/forms/PHP trick that's floating around out there - an excellent bit of logical tomfoolery, that, but it does act as a redirect, thus messing up the back button.
The basic problem here seems to be that the header transmitted to the server when a client accesses a page does not include the client's screen size. Perl, PHP and even ASP don't have that as one of their environment variables, though I've heard that ASP gets around it by embedding JavaScript, which has access to the DOM. (Haven't tried this myself, as the server I'm working with doesn't run any form of ASP.)
So... anybody have any bright ideas on how to do this? I'm not that hopeful, since the most popular approach out there, the JavaScript/form/PHP hack, is the biggest kludge I've ever seen - but perhaps one of you has some insight on this.
[edit] One further note - the purpose of this check is to dynamically create the page in question, not just to store the information. Thus, floR's suggestion below won't work.[/edit]
Thanks,
Ben