Page 1 of 1

user information?

Posted: Tue Feb 04, 2003 8:34 am
by AndrewBacca
im creating a counter at the moment, but I want to be able to store the os, screen resolution and screen depth of each hit.

is it possible, if so how?

thankyou
Andrew

Posted: Tue Feb 04, 2003 9:59 am
by patrikG
Yes, it can be done, but not reliably. You would need a mixture of javascript and PHP. You can get the OS through HTTP_Header in PHP, screen resolution and depth via Javascript.

Off the top of my head:

- have an invisible frame (height=0, widht=0) in which you load a page containing

a) javascript which checks screen resolution and screen depth.
b) a form.

In <body> have onload='checkAndSubmit()', where checkAndSubmit() is the javascript-function which fills in the values into form and the auto-submits the form. That way you have the values available in PHP.

This is, however, unreliable, since some people have Javascript switched off, or some browsers don't support screen-dimension stuff.

Hope that helps.