SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Resolving browser and OS from referer

    Any ideas how I can extract a users Browser and OS from $_SERVER['HTTP_USER_AGENT'] ?

    Thanks,

  2. #2
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Here's a list of what to search for; it's not definitive but it should help you out:
    Code:
    Browser        Presence of        Absence of
    IE             "MSIE"             "Opera"
    Moz/NS6+       "Gecko"            "Safari"
    Safari         "Safari"
    Opera          "Opera"
    Netscape 4.x     "Mozilla/4.x"*
    
    *Replace the x with the version of Netscape you want. IE reports Mozilla/4.0 so be careful!

  3. #3
    SitePoint Addict mserms's Avatar
    Join Date
    Jun 2001
    Location
    Scotland
    Posts
    230
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Vinnie, very handy.

    Is there anything similar around for operating systems?

  4. #4
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by mserms
    Thanks Vinnie, very handy.

    Is there anything similar around for operating systems?
    For Windows, search for "Win"
    For Mac, search for "Mac"
    For Linux, search for "Linux"
    Not sure about Solaris, FreeBSD, BeOS, etc. though.

  5. #5
    AdSpeed.com Son Nguyen's Avatar
    Join Date
    Aug 2000
    Location
    Silicon Valley
    Posts
    2,241
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have a look at this function:
    http://www.php.net/get_browser

    The dataset could be obtained from here:
    http://www.garykeith.com/browsers/downloads.asp
    - Son Nguyen
    AdSpeed.com - Ad Serving and Ad Management Made Easy


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •