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
user information?
Moderator: General Moderators
- AndrewBacca
- Forum Commoner
- Posts: 62
- Joined: Thu Jan 30, 2003 10:03 am
- Location: Isle of Wight, UK
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.
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.