Determining OS

Discussion in 'HTML' started by Ike, Feb 5, 2005.

  1. Ike

    Ike Guest

    Is there a means of determining what Operating System a client is on. I am
    trying to forward a client to a different page if they are on a Windows
    system than on a different system, and am wondering just how this can
    possibly be accomplished. Thanks, Ike
     
    Ike, Feb 5, 2005
    #1
    1. Advertising

  2. Ike

    Oli Filth Guest

    Ike wrote:
    > Is there a means of determining what Operating System a client is on. I am
    > trying to forward a client to a different page if they are on a Windows
    > system than on a different system, and am wondering just how this can
    > possibly be accomplished. Thanks, Ike
    >
    >


    You can do this from a server-side script using the HTTP_USER_AGENT
    header. e.g. in PHP, the server variable $_SERVER["HTTP_USER_AGENT"]
    contains a string that the user's browser sends to describe itself. e.g.:

    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107
    Firefox/1.0


    --
    Oli
     
    Oli Filth, Feb 5, 2005
    #2
    1. Advertising

  3. On Sat, 05 Feb 2005 16:28:59 GMT, Oli Filth <>
    wrote:

    > Ike wrote:
    >> Is there a means of determining what Operating System a client is on. I am
    >> trying to forward a client to a different page if they are on a Windows
    >> system than on a different system, and am wondering just how this can
    >> possibly be accomplished. Thanks, Ike
    >>

    >
    > You can do this from a server-side script using the HTTP_USER_AGENT header.
    > e.g. in PHP, the server variable $_SERVER["HTTP_USER_AGENT"] contains a string
    > that the user's browser sends to describe itself. e.g.:
    >
    > Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5) Gecko/20041107
    > Firefox/1.0
    >


    Just curious: Why would one do that?



    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Feb 5, 2005
    #3
  4. Ike wrote:

    > Is there a means of determining what Operating System a client is on. I am
    > trying to forward a client to a different page if they are on a Windows
    > system than on a different system


    Why?

    > and am wondering just how this can possibly be accomplished.


    You can look at the User Agent string. Note, however, that it doesn't always
    include the OS, and is often munged. Make sure that being redirected to the
    wrong page will not inconvenience users.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 5, 2005
    #4
  5. Ike

    Spartanicus Guest

    "Ike" <> wrote:

    >Is there a means of determining what Operating System a client is on.


    Not reliably.

    >I am
    >trying to forward a client to a different page if they are on a Windows
    >system than on a different system, and am wondering just how this can
    >possibly be accomplished.


    Let the user choose:

    <a href="windows.htm">Windows OS</a>, <a href="other.htm">Other OS's</a>

    --
    Spartanicus
     
    Spartanicus, Feb 5, 2005
    #5
  6. Ike

    Oli Filth Guest

    Barbara de Zoete wrote:
    > On Sat, 05 Feb 2005 16:28:59 GMT, Oli Filth
    > <> wrote:
    >
    >> Ike wrote:
    >>
    >>> Is there a means of determining what Operating System a client is on.
    >>> I am
    >>> trying to forward a client to a different page if they are on a Windows
    >>> system than on a different system, and am wondering just how this can
    >>> possibly be accomplished. Thanks, Ike
    >>>

    >>
    >> You can do this from a server-side script using the HTTP_USER_AGENT
    >> header. e.g. in PHP, the server variable $_SERVER["HTTP_USER_AGENT"]
    >> contains a string that the user's browser sends to describe itself.
    >> e.g.:
    >>
    >> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
    >> Gecko/20041107 Firefox/1.0
    >>

    >
    > Just curious: Why would one do that?
    >


    Because it also contains a representation of the OS, which one could use
    to perform redirection, etc. from the server.

    Note that I should have said that this is less than reliable, as many
    browsers send incorrect information (either by accident or on purpose).


    --
    Oli
     
    Oli Filth, Feb 5, 2005
    #6
  7. On Sat, 05 Feb 2005 16:48:11 GMT, Oli Filth <>
    wrote:

    > Because it also contains a representation of the OS, which one could use to
    > perform redirection, etc. from the server.
    >


    I wasn't very clear, obviously. So let me refrase:

    Why would one redirect based on the OS of the visitor?


    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Feb 5, 2005
    #7
  8. Ike

    Els Guest

    Barbara de Zoete wrote:

    > On Sat, 05 Feb 2005 16:48:11 GMT, Oli Filth
    > <> wrote:
    >
    >> Because it also contains a representation of the OS, which
    >> one could use to perform redirection, etc. from the
    >> server.
    >>

    >
    > I wasn't very clear, obviously. So let me refrase:
    >
    > Why would one redirect based on the OS of the visitor?


    Maybe in case of OS specific downloads? Still not a good reason
    to automate that process, as I do actually sometimes download
    Linux stuff with Windows and vice versa. I then use the local
    LAN to get it to the right place.

    --
    Els
    http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Feb 5, 2005
    #8
  9. On 5 Feb 2005 16:54:51 GMT, Els <> wrote:

    > Barbara de Zoete wrote:
    >
    >> On Sat, 05 Feb 2005 16:48:11 GMT, Oli Filth
    >> <> wrote:
    >>
    >>> Because it also contains a representation of the OS, which
    >>> one could use to perform redirection, etc. from the
    >>> server.
    >>>

    >>
    >> I wasn't very clear, obviously. So let me refrase:
    >>
    >> Why would one redirect based on the OS of the visitor?

    >
    > Maybe in case of OS specific downloads?


    Makes sense.

    > Still not a good reason
    > to automate that process, as I do actually sometimes download
    > Linux stuff with Windows and vice versa. I then use the local
    > LAN to get it to the right place.
    >


    Makes more sense. :)

    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Feb 5, 2005
    #9
  10. Els wrote:

    >> Why would one redirect based on the OS of the visitor?


    > Maybe in case of OS specific downloads? Still not a good reason
    > to automate that process


    Its a reasonable way to choose between a page with a big, obvious Windows
    download link along with a lot of less obvious links for other systems, and
    a page with a big obvious Mac download link along with ... etc etc.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, Feb 5, 2005
    #10
  11. Ike

    Els Guest

    David Dorward wrote:

    > Els wrote:
    >
    >>> Why would one redirect based on the OS of the visitor?

    >
    >> Maybe in case of OS specific downloads? Still not a good
    >> reason to automate that process

    >
    > Its a reasonable way to choose between a page with a big,
    > obvious Windows download link along with a lot of less
    > obvious links for other systems, and a page with a big
    > obvious Mac download link along with ... etc etc.


    Agreed :)

    --
    Els
    http://locusmeus.com/
    Sonhos vem. Sonhos vão. O resto é imperfeito.
    - Renato Russo -
     
    Els, Feb 5, 2005
    #11
  12. Ike

    Ike Guest

    Because, I have a Java Applet which uses Microspft SAPI speech engine (or
    not) -- If they have Windows, I branch to a page that uses the Applet that
    has SAPI, otherwise, to the page that doesn't! -Ike

    "Barbara de Zoete" <> wrote in message
    news:eek:pslqg5twqx5vgts@zoete_b...
    > On Sat, 05 Feb 2005 16:48:11 GMT, Oli Filth

    <>
    > wrote:
    >
    > > Because it also contains a representation of the OS, which one could use

    to
    > > perform redirection, etc. from the server.
    > >

    >
    > I wasn't very clear, obviously. So let me refrase:
    >
    > Why would one redirect based on the OS of the visitor?
    >
    >
    > --
    > ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    > | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    > | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    > |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    > `-------------------------------------------------- --<--@ ------------'
     
    Ike, Feb 5, 2005
    #12
  13. On Sat, 05 Feb 2005 23:04:36 GMT, Ike <> wrote:

    Please, do not toppost. Corrected this once.

    > "Barbara de Zoete" <> wrote in message
    > news:eek:pslqg5twqx5vgts@zoete_b...
    >> On Sat, 05 Feb 2005 16:48:11 GMT, Oli Filth
    >> <>
    >> wrote:
    >>
    >>> Because it also contains a representation of the OS, which one could use
    >>> to
    >>> perform redirection, etc. from the server.
    >>>

    >> I wasn't very clear, obviously. So let me refrase:
    >>
    >> Why would one redirect based on the OS of the visitor?
    >>

    > Because, I have a Java Applet which uses Microspft SAPI speech engine (or
    > not) -- If they have Windows, I branch to a page that uses the Applet that
    > has SAPI, otherwise, to the page that doesn't! -Ike
    >


    Oh, wow. So I use Opera as my main browser, doesn't allow Java, Java-applet,
    JavaScript, and certainly not any other active content. It does run on a
    WindowsXP machine, so I get (re)directed to a page that does not work at all.
    Nice punishment for not having switched to a decent OS. Thank you very much :p

    >>
    >> --


    Please delete signature as it is not part of the message you reply to.

    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Feb 5, 2005
    #13
  14. Ike

    Oli Filth Guest

    Ike wrote:
    > Because, I have a Java Applet which uses Microspft SAPI speech engine (or
    > not) -- If they have Windows, I branch to a page that uses the Applet that
    > has SAPI, otherwise, to the page that doesn't! -Ike
    >


    Would it not make more sense to perform the OS check within the Java
    applet (e.g. using System.getProperty("os.name") or whatever), and not
    the containing page?


    --
    Oli
     
    Oli Filth, Feb 5, 2005
    #14
  15. Barbara de Zoete wrote:
    > Oh, wow. So I use Opera as my main browser, doesn't allow Java,
    > Java-applet, JavaScript, and certainly not any other active content. It
    > does run on a WindowsXP machine, so I get (re)directed to a page that
    > does not work at all. Nice punishment for not having switched to a
    > decent OS. Thank you very much :p


    Well that is the price for being on the cutting edge and using a
    minority browser. I guess there are consequences for our actions. For
    the OP, he loses you as a customer. For you, you lose the content he
    was going to show.

    --
    -=tn=-
     
    Travis Newbury, Feb 6, 2005
    #15
  16. Ike

    Richard Guest

    On Sat, 05 Feb 2005 17:37:31 +0100 Barbara de Zoete wrote:

    > On Sat, 05 Feb 2005 16:28:59 GMT, Oli Filth
    > <>
    > wrote:


    >> Ike wrote:
    >>> Is there a means of determining what Operating System a client is on.
    >>> I am
    >>> trying to forward a client to a different page if they are on a
    >>> Windows
    >>> system than on a different system, and am wondering just how this can
    >>> possibly be accomplished. Thanks, Ike



    >> You can do this from a server-side script using the HTTP_USER_AGENT
    >> header.
    >> e.g. in PHP, the server variable $_SERVER["HTTP_USER_AGENT"] contains
    >> a string
    >> that the user's browser sends to describe itself. e.g.:


    >> Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.5)
    >> Gecko/20041107
    >> Firefox/1.0



    > Just curious: Why would one do that?


    A lot of counter stats use the routine to show the user what operating
    systems and browsers were used, not to mention screen resolution.
    If you're that worried about showing the proper page to the visitor, then
    you could use it to reroute the visitor to an appropriate page.
    For instance, a visitor is using IE and due to the peculiarities of IE, you
    might have a page written just for them, where the same page would not work
    in netscape.
     
    Richard, Feb 6, 2005
    #16
  17. Travis Newbury wrote:

    > Barbara de Zoete wrote:


    >> Oh, wow. So I use Opera as my main browser, doesn't allow Java,
    >> Java-applet, JavaScript, and certainly not any other active content. It
    >> does run on a WindowsXP machine, so I get (re)directed to a page that
    >> does not work at all. Nice punishment for not having switched to a
    >> decent OS. Thank you very much :p


    > Well that is the price for being on the cutting edge and using a
    > minority browser. I guess there are consequences for our actions. For


    No, that's what happens when you've configured your Java- and
    JavaScript-capable browser not to do Java or JavaScript.

    --
    Blinky Linux Registered User 297263

    Who has implemented Usenet Solution #45933:
    Now killing all posts made with User-Agent G2
     
    Blinky the Shark, Feb 6, 2005
    #17
  18. Blinky the Shark wrote:

    > Travis Newbury wrote:


    >> Barbara de Zoete wrote:


    >>> Oh, wow. So I use Opera as my main browser, doesn't allow Java,
    >>> Java-applet, JavaScript, and certainly not any other active content. It
    >>> does run on a WindowsXP machine, so I get (re)directed to a page that
    >>> does not work at all. Nice punishment for not having switched to a
    >>> decent OS. Thank you very much :p


    >> Well that is the price for being on the cutting edge and using a
    >> minority browser. I guess there are consequences for our actions. For


    > No, that's what happens when you've configured your Java- and
    > JavaScript-capable browser not to do Java or JavaScript.


    Which statement should not be taken to mean that such control and
    exercise of it are bad things. I simply meant that it's not a matter
    of using a non-Redmond browser; it's a matter of the user having choices
    of how the browser is used.

    --
    Blinky Linux Registered User 297263

    Who has implemented Usenet Solution #45933:
    Now killing all posts made with User-Agent G2
     
    Blinky the Shark, Feb 6, 2005
    #18
  19. Ike

    Toby Inkster Guest

    Travis Newbury wrote:
    > Barbara de Zoete wrote:
    >
    >> Oh, wow. So I use Opera as my main browser, doesn't allow Java,
    >> Java-applet, JavaScript, and certainly not any other active content.

    >
    > Well that is the price for being on the cutting edge and using a
    > minority browser.


    To clarify Barbara's statement, Opera supports Java and Javascript just
    fine, but Barbara has chosen to disable them.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Feb 6, 2005
    #19
  20. On Sat, 05 Feb 2005 21:54:33 -0500, Travis Newbury <> wrote:

    > Barbara de Zoete wrote:
    >> Oh, wow. So I use Opera as my main browser, doesn't allow Java, Java-applet,
    >> JavaScript, and certainly not any other active content. It does run on a
    >> WindowsXP machine, so I get (re)directed to a page that does not work at
    >> all. Nice punishment for not having switched to a decent OS. Thank you very
    >> much :p

    >
    > Well that is the price for being on the cutting edge and using a minority
    > browser. I guess there are consequences for our actions. For the OP, he
    > loses you as a customer. For you, you lose the content he was going to show.
    >


    Wooh, wow. I wonder who loses the most ;-)

    As others pointed out my 'doesn't' in 'So I use Opera as my main browser,
    doesn't allow ...' should have been don't. Opera gives me the choice to easily
    enable or disable all that stuff. I choose to disable it.

    --
    ,-- --<--@ -- PretLetters: 'woest wyf', met vele interesses: ----------.
    | weblog | http://home.wanadoo.nl/b.de.zoete/_private/weblog.html |
    | webontwerp | http://home.wanadoo.nl/b.de.zoete/html/webontwerp.html |
    |zweefvliegen | http://home.wanadoo.nl/b.de.zoete/html/vliegen.html |
    `-------------------------------------------------- --<--@ ------------'
     
    Barbara de Zoete, Feb 6, 2005
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?ISO-8859-1?Q?Johan_Bernsp=E5ng?=

    determining of the position of the MSB

    =?ISO-8859-1?Q?Johan_Bernsp=E5ng?=, Jul 27, 2004, in forum: VHDL
    Replies:
    20
    Views:
    3,192
    Jonathan Bromley
    Aug 2, 2004
  2. Gunnar Hjalmarsson

    determining file size

    Gunnar Hjalmarsson, Aug 13, 2004, in forum: Perl
    Replies:
    2
    Views:
    449
    Jürgen Exner
    Aug 13, 2004
  3. Marshall Dudley

    Determining connection type

    Marshall Dudley, Dec 7, 2004, in forum: Perl
    Replies:
    0
    Views:
    478
    Marshall Dudley
    Dec 7, 2004
  4. WebDevHokie
    Replies:
    2
    Views:
    337
  5. Greg Hurlman

    Determining the height of a control?

    Greg Hurlman, Jul 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    339
    Greg Hurlman
    Jul 30, 2003
Loading...

Share This Page