Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
78
rated 0 times [  82] [ 4]  / answers: 1 / hits: 58636  / 16 Years ago, sun, march 15, 2009, 12:00:00

I was wondering if there is a way I can detect the exact Operating System version from my browser using PHP/JS/ASP?



I know I can detect the type of OS (Windows XP,Windows Vista,OS X,etc) but I need to detect the exact version: Vista Business, Vista Ultimate, Windows XP Home, Windows XP Pro, etc...


More From » php

 Answers
7

Short answer: You can't.


Long answer:


All you have is the information in the HTTP User-Agent header, which usually contains the OS name and version.


Usually, browsers running on Mac OS and Linux send enough information to identify the exact OS. For example, here's my User-Agent header:



Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.7) Gecko/2009030423 Ubuntu/8.10 (intrepid) Firefox/3.0.7



You can see that I'm running Ubuntu 8.10 Intrepid Ibex.


And here's what Firefox and Safari 4 Beta report on my MacBook Pro:



Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.0.7) Gecko/2009021906 Firefox/3.0.7


Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_6; en-us) AppleWebKit/528.16 (KHTML, like Gecko) Version/4.0 Safari/528.16



Windows browsers, on the other hand, usually only report the OS version and not the specific package (Pro, Business, etc.):



Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:x.x.x) Gecko/20041107 Firefox/x.x



[#99843] Tuesday, March 10, 2009, 16 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jack

Total Points: 557
Total Questions: 96
Total Answers: 80

Location: Saint Helena
Member since Mon, Jan 16, 2023
1 Year ago
jack questions
Sun, Jan 31, 21, 00:00, 3 Years ago
Thu, Dec 10, 20, 00:00, 3 Years ago
Sat, Aug 1, 20, 00:00, 4 Years ago
Fri, Apr 17, 20, 00:00, 4 Years ago
Wed, Aug 14, 19, 00:00, 5 Years ago
;