0

I want to identify user OS is a Debian or Redhat based using a PHP script and give users to download relevant packs (Debian - .deb, Redhat - .rpm). I used '$_SERVER['HTTP_USER_AGENT']' to get user OS type and following the results of 3 browsers (I checked this with Ubuntu)

Chrome

*Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36*

Opera

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.87 Safari/537.36 OPR/54.0.2952.51

Firefox

Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:61.0) Gecko/20100101 Firefox/61.0

As in the result, Firefox gives user os name (Ubuntu) and other 2 gives the only Linux. So I can't find user OS is a Debian or a Redhat in Chrome and Opera.

How can I find OS type in PHP? Is there any other way to fin OS type?

Any help is really appreciated, Thanks

indrarajw
  • 198
  • 2
  • 18
  • 2
    Possible duplicate of [Operating System from User-Agent HTTP Header](https://stackoverflow.com/questions/228256/operating-system-from-user-agent-http-header) – tanaydin Jul 29 '18 at 15:48
  • @tanaydin It's not the same question, I want to know how to find user OS type (Debian or Redhat) in Chrome/Opera browsers. – indrarajw Jul 29 '18 at 16:06
  • after your comment I'm 100% sure it is same and duplicate. – tanaydin Jul 30 '18 at 09:27
  • @tanaydin In Firefox return user OS type as 'Ubuntu; Linux' and Chrome returns only 'Linux' to '$_SERVER['HTTP_USER_AGENT']'. I want to know is there a way to get user OS is 'Ubuntu' or 'Centos' in Chrome. Your question didn't explain this, It's about general User-Agent HTTP Header strings to operating systems mapping list. – indrarajw Aug 01 '18 at 09:04
  • Mine is not a question, answer for your problem. there is enough information already in there, no one will copy the same information to here... Please try to understand it. – tanaydin Aug 01 '18 at 13:47

0 Answers0