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

5
  • 2
    Possible duplicate of Operating System from User-Agent HTTP Header Commented Jul 29, 2018 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. Commented Jul 29, 2018 at 16:06
  • after your comment I'm 100% sure it is same and duplicate. Commented Jul 30, 2018 at 9: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. Commented Aug 1, 2018 at 9: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. Commented Aug 1, 2018 at 13:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.