-1

Possible Duplicate:
Code to parse user agent string?

I'm tracking my user's browsers to better get a feel for their experience (see if there's any connection between a certain browser and a certain behavior). I'm inserting the result of

$_SERVER['HTTP_USER_AGENT'];

into a mysql table. However, I'm not quite sure how to read it. For instance, there was a signup today with the following value:

Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.57.2 (KHTML, like Gecko) Version/5.1.7 Safari/534.57.2

So which one is it? why is it listing three browsers? How do I read this? You can try this for yourself at: http://www.glassreel.com/whoami.php

Thanks!

Community
  • 1
  • 1
Daniel F. Dietzel
  • 147
  • 1
  • 2
  • 11
  • 1
    browser send such obscure id's because people have historically always used it to serve different content based on what browser requests a page. browsers don't like this, because tomorrow they may get an update and now be capable of displaying some content someone previously blocked. so, they try to trick you. the list of different user agent strings is incredibly large. – goat Jan 17 '13 at 01:19
  • just for your info, that variable can be spoofed (tampered) so I think its a bit unrealiable – ianace Jan 17 '13 at 01:45
  • Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:18.0) Gecko/20100101 Firefox/18.0 – hek2mgl Jan 17 '13 at 02:06

1 Answers1

1

I am close to sure that the web browser is Chrome.

There is only one way to test this and you probably know it. Installing IE, Firefox and Chrome and signing up yourself.

In the meantime, you can use get_browser() function and parse the array ([browser_name_pattern]) and then insert it into your database.

I hope this helps

Taicho
  • 143
  • 5
  • It's not Chrome, as it doesn't mention Chrome in the string. It's just the Windows version of Safari. – Charles Jan 17 '13 at 03:11