Solved

browscaps get OS version

Posted on 2012-03-12
3
379 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 110

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 110

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

These days socially coordinated efforts have turned into a critical requirement for enterprises.
Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
The viewer will learn how to dynamically set the form action using jQuery.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

740 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