Hi Guys

I am completely stumped here for some reason. I know that you can obtain a users browser by using the following:

echo $_SERVER['HTTP_USER_AGENT'];

But now, how does one obtain the users operating system?

I have developed a little WAP site for our website and now I want to put a check on the site so that if a user browses from a WAP browser it will redirect them to the appropriate page.

Is this the correct way of going about it, but doing a check on the users operating system? This is a problem as there are so many cellphones using different operating systems and browsers.

Does anyone have any ideas?

    Edit: Thanks Weedpacket for correcting me... :o

      Of course, the information is often included in the User-Agent string (that's how [man]get_browser[/man] works). It's just a matter of reading it.

      Of course, there's no guarantee that the User-Agent string hasn't been faked.

      Of course, anything coming from the client could be faked.

        Write a Reply...