View Full Version : Detecting resolution accurately
Pauly
January 19th, 2005, 23:28
I know you can detect a users browser accurately, but I'm not sure what programming language is used. Also, based upon the result of the resolution, you choose where to forward them to?
The purpose is an experiment, nothing serious or professional.
ethicaldesign
January 20th, 2005, 00:45
$_SERVER['HTTP_USER_AGENT'] in php will give you the browser string, but
get_browser is more useful (see http://uk.php.net/manual/en/function.get-browser.php).
As far as I know, detecting the screen resolution needs to be done with javascript (using screen.width and screen.height) as it's only possible to work that out client side.
You can detect it once and put it in a cookie, then read that cookie back in php though. There's an explanation of this at: http://www.phpbuddy.com/article.php?id=8
(I can hear the_pm Paul's eyes rolling in their sockets as I speak :D).
ethicaldesign
January 20th, 2005, 00:49
Quick update on that second script: http://regretless.com/scripts/basics/get_screen_width_height.php (this looks like it would work better for you).
the_pm
January 20th, 2005, 00:52
Nope. Riddick knows the inherent dangers of what he's doing, and he's not applying it to a project where it's going to having any particularly adverse effect on the general population. Yeah, I think these techniques are crap, but I experiment with crap too from time to time. It's all good :)
Pauly
January 20th, 2005, 01:01
Thanks will check them out :)
Paul - I re-adjusted the purpose of the experiment, I'll send you the revision once I'm ready to build it completely, you might understand it a little better then ;)
Christina
January 20th, 2005, 02:18
I prefer cleanliness....so messing with crap is a no no :lol:
Pauly
January 20th, 2005, 18:37
:lol: We will see how well it works ;)
vBulletin® v3.6.8, Copyright ©2000-2010, Jelsoft Enterprises Ltd.