Jump to content

Archived

This topic is now archived and is closed to further replies.

michaellunsford

Determining a visitor's Operating System

Recommended Posts

Thus quoteth the manual:
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--] While browscap.ini contains information on many browsers, it relies on user updates to keep the database current.[/quote]

okay, we know get_browser isn't the solution. Is there an easier way to just find out what a site visitor's operating system is?

Share this post


Link to post
Share on other sites
As Crayon_Violent pointed out, HTTP_USER_AGENT, which is a part of the global variable $_SERVER[]

$_SERVER['HTTP_USER_AGENT']

Share this post


Link to post
Share on other sites
I had hoped not to explode USER_AGENT by ";" and write a function to interpret the third array object. I guess browscap.ini is starting to look better than I thought.

Share this post


Link to post
Share on other sites
get_browser RELIES on the USER_AGENT:

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]mixed get_browser ( [string [b]user_agent[/b] [, bool return_array]] )[/quote]

It IS the best option. Finito. Maybe you can code something similar, but you'll have to use the USER_AGENT header anyways

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.