Results 1 to 3 of 3

Thread: Operating Systems script

  1. #1
    Join Date
    Sep 2005
    Location
    Bogota, Colombia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Post Operating Systems script

    Hello
    I have a problem.
    How i can write in the page the Operating Systems of the user?

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    A good question. The OS is contained in the User-Agent header, but isn't always in the same place. You really have to do something like this:
    Code:
    $os = "Other";
    $ua = strtolower($_SERVER['HTTP_USER_AGENT']);
    if(strpos($ua, "linux") != -1) $os = "Linux";
    if(strpos($ua, "windows") != -1) $os = "Windows";
    if(strpos($ua, "apple") != -1) $os = "Mac";
    if(strpos($ua, "bsd") != -1) $os = "BSD";
    // ...
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Sep 2005
    Location
    Bogota, Colombia
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks you

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
  •