[Xitami] Screen Resolution...

Francis Turner xitami@lists.xitami.org
Fri, 29 Jun 2001 11:26:55 -0400


Comment below

Thomas J. Hruska wrote:

> As I was playing around with IE, I noticed that the headers contain some
> extremely useful data that my CGI-based applications could use.  I have
> this interesting idea that Xitami could do something horribly non-standard
> and pass all of the headers onto my CGI (filter) through another
> environment variable.  Here is what I propose:
> 
> 1)  Create a configuration file option to turn on/off the COMPLETE_HEADERS
> environment variable.
> 2)  During runtime, if the environment variable option is on, then the
> COMPLETE_HEADERS variable is created.  Xitami stores the headers into the
> environment variable as a zero-terminated URL encoded string.
> 
> Of particular interest to me (and probably a few others) are the headers:
> 
> UA-pixels: 1152x864
> UA-color: color16
> UA-OS: Windows NT
> UA-CPU: x86
> 
> Now, I could use JavaScript to do what I want on the client end of things,
> but it would be nice to just grab and parse the headers for the information

Since this is coming from a form - create a hidden field which is 
populated by Javascript. The JS can query the browser for those fields. 
This works with all browsers and is trivial to implement and you don't 
need any cookies.

For example

<form name=myForm><script>
  document.writeln('<INPUT TYPE="hidden" NAME="hiddenObject" VALUE="' +
     screen.width + "," + screen.height + "," +
     screen.pixelDepth + "," + screen.colorDepth + "'>" )
</script>
rest of form </form>

-- 
"Education is when you read the fine print; 
 experience is what you get when you don't." Pete Seeger