Solved

browscaps get OS version

Posted on 2012-03-12
3
370 Views
Last Modified: 2012-04-11
I can get the browser info as follows

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.0.13.81_10003810) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true

but, when I use the browscap.ini I only get that it is XYZ browser on a Mac OS X.  I want to know what version of the OS is installed.
0
Comment
Question by:lvmllc
  • 2
3 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 37712352
When you write, I can get the browser info as follows how do you get this information?

Please use var_dump() to print the output from the browscap instructions and post it here, thanks.
0
 

Author Comment

by:lvmllc
ID: 37718247
two examples - the first is capable of identifying the version of Mac OS X while the get_browser() does not.


echo $_SERVER['HTTP_USER_AGENT'];
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

$browser = get_browser(null,true);
var_dump($browser);

array(28) { ["browser_name_regex"]=> string(53) "^mozilla/5\.0 (.*mac os x.*) gecko/.* firefox/10\..*$" ["browser_name_pattern"]=> string(45) "Mozilla/5.0 (*Mac OS X*) Gecko/* Firefox/10.*" ["parent"]=> string(12) "Firefox 10.0" ["platform"]=> string(6) "MacOSX" ["win32"]=> string(0) "" ["browser"]=> string(7) "Firefox" ["version"]=> string(4) "10.0" ["majorver"]=> string(2) "10" ["frames"]=> string(1) "1" ["iframes"]=> string(1) "1" ["tables"]=> string(1) "1" ["cookies"]=> string(1) "1" ["javascript"]=> string(1) "1" ["javaapplets"]=> string(1) "1" ["cssversion"]=> string(1) "3" ["minorver"]=> string(1) "0" ["alpha"]=> string(0) "" ["beta"]=> string(0) "" ["win16"]=> string(0) "" ["win64"]=> string(0) "" ["backgroundsounds"]=> string(0) "" ["vbscript"]=> string(0) "" ["activexcontrols"]=> string(0) "" ["isbanned"]=> string(0) "" ["ismobiledevice"]=> string(0) "" ["issyndicationreader"]=> string(0) "" ["crawler"]=> string(0) "" ["aolversion"]=> string(1) "0" }
0
 
LVL 108

Accepted Solution

by:
Ray Paseur earned 300 total points
ID: 37719758
OK, I think I understand your question.  The USER_AGENT string is dynamically generated by the client that initiated the request.  The get_browser() function looks up the browser's information in your browscap.ini file; browscap.ini relies on user updates to keep the database current.  Looks like it does not reveal details of the underlying platform.  To quote the BCP
User agent detection is still a long ways away from being 100% accurate...
You may find some useful information at this link.
http://browsers.garykeith.com/stream.asp?PHP_BrowsCapINI

Here is my USER_AGENT
Mozilla/5.0 (Windows NT 6.1; rv:10.0.2) Gecko/20100101 Firefox/10.0.2

Looks like the best information you can get is from USER_AGENT.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now