OS Detect

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Alexandre Plennevaux

    OS Detect

    hello,

    would it be possible to detect the client's OS system with php?
    i don't need much detail, only if its a Windows, a linux or a macintosh
    system.

    any idea?

    thanks,

    Alexandre


  • CountScubula

    #2
    Re: OS Detect

    "Alexandre Plennevaux" <alexandre@la b-au.com> wrote in message
    news:4005e1c7$0 $1145$ba620e4c@ news.skynet.be. ..[color=blue]
    > hello,
    >
    > would it be possible to detect the client's OS system with php?
    > i don't need much detail, only if its a Windows, a linux or a macintosh
    > system.
    >
    > any idea?
    >
    > thanks,
    >
    > Alexandre
    >
    >[/color]

    check

    $_SERVER['HTTP_USER_AGEN T'];

    Sometimes the os is in there.


    --
    Mike Bradley
    http://www.gzentools.com -- free online php tools



    Comment

    • Pedro Graca

      #3
      Re: OS Detect

      Alexandre Plennevaux wrote:[color=blue]
      > would it be possible to detect the client's OS system with php?
      > i don't need much detail, only if its a Windows, a linux or a macintosh
      > system.
      >
      > any idea?[/color]

      No guarantees:

      <?php
      if (stripos($_SERV ER['HTTP_USER_AGEN T'], 'win') !== FALSE) {
      // client is using a windows browser
      } else {
      // he is using Un*x :)
      }
      ?>
      --
      --= my mail box only accepts =--
      --= Content-Type: text/plain =--
      --= Size below 10001 bytes =--

      Comment

      • Alexandre Plennevaux

        #4
        Re: OS Detect

        thanks mike and Pedro,

        I knew there was something like that, just couldn't find it in the manual.
        thanks a lot !

        Alexandre


        "CountScubu la" <me@scantek.hot mail.com> wrote in message
        news:drlNb.1063 $e25.239@newssv r29.news.prodig y.com...[color=blue]
        > "Alexandre Plennevaux" <alexandre@la b-au.com> wrote in message
        > news:4005e1c7$0 $1145$ba620e4c@ news.skynet.be. ..[color=green]
        > > hello,
        > >
        > > would it be possible to detect the client's OS system with php?
        > > i don't need much detail, only if its a Windows, a linux or a macintosh
        > > system.
        > >
        > > any idea?
        > >
        > > thanks,
        > >
        > > Alexandre
        > >
        > >[/color]
        >
        > check
        >
        > $_SERVER['HTTP_USER_AGEN T'];
        >
        > Sometimes the os is in there.
        >
        >
        > --
        > Mike Bradley
        > http://www.gzentools.com -- free online php tools
        >
        >
        >[/color]


        Comment

        Working...