Determining if user is using Win98 & MSIE

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • - Dazed

    #1

    Determining if user is using Win98 & MSIE

    If a user is using a combination of Win98 & any version of MSIE, I
    want to display a message.
    The best that I can do is the following:
    <?
    if ((strstr (getenv('HTTP_U SER_AGENT'), 'MSIE')) && (strstr
    (getenv('HTTP_U SER_AGENT'), '98')))
    {
    echo"blah,blah, blah\n";
    }
    ?>
    Is there a better (more foolproof) way?
    Thanks!
  • Randy Webb

    #2
    Re: Determining if user is using Win98 &amp; MSIE

    - Dazed wrote:[color=blue]
    > If a user is using a combination of Win98 & any version of MSIE, I
    > want to display a message.[/color]

    That's not as easy as you think it might be.
    [color=blue]
    > The best that I can do is the following:
    > <?
    > if ((strstr (getenv('HTTP_U SER_AGENT'), 'MSIE')) && (strstr
    > (getenv('HTTP_U SER_AGENT'), '98')))
    > {
    > echo"blah,blah, blah\n";
    > }
    > ?>
    > Is there a better (more foolproof) way?[/color]

    Yes and no. Browser Detection based on the User Agent String is very
    fundamentally flawed since many browsers spoof other browsers since
    sites think they need to give certain browsers messages, or totally
    different pages, because they think they know what browser the user is
    using.

    And when using Mozilla, I can make it pass your above test even though
    it is not MSIE and it is not running on Windows98. So what exactly is
    the problem you are trying to solve?

    --
    Randy
    comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

    Comment

    • - Dazed

      #3
      Re: Determining if user is using Win98 &amp; MSIE

      Randy Webb <HikksNotAtHome @aol.com> wrotc:
      [color=blue]
      >- Dazed wrote:[color=green]
      >> If a user is using a combination of Win98 & any version of MSIE, I
      >> want to display a message.[/color]
      >
      >That's not as easy as you think it might be.
      >[color=green]
      >> The best that I can do is the following:
      >> <?
      >> if ((strstr (getenv('HTTP_U SER_AGENT'), 'MSIE')) && (strstr
      >> (getenv('HTTP_U SER_AGENT'), '98')))
      >> {
      >> echo"blah,blah, blah\n";
      >> }
      >> ?>
      >> Is there a better (more foolproof) way?[/color]
      >
      >Yes and no. Browser Detection based on the User Agent String is very
      >fundamentall y flawed since many browsers spoof other browsers since
      >sites think they need to give certain browsers messages, or totally
      >different pages, because they think they know what browser the user is
      >using.
      >
      >And when using Mozilla, I can make it pass your above test even though
      >it is not MSIE and it is not running on Windows98. So what exactly is
      >the problem you are trying to solve?[/color]
      There has been an occasional site inconsistency when a user is using a
      combination of Win98 & MSIE. Never with WinME, Win2K or WinXP. If they
      are using a combination of Win98 & MSIE, I want to display a message
      as such.

      Comment

      • Randy Webb

        #4
        Re: Determining if user is using Win98 &amp; MSIE

        - Dazed wrote:[color=blue]
        > Randy Webb <HikksNotAtHome @aol.com> wrotc:
        >
        >[color=green]
        >>- Dazed wrote:[/color][/color]

        <--snip-->
        [color=blue][color=green]
        >>And when using Mozilla, I can make it pass your above test even though
        >>it is not MSIE and it is not running on Windows98. So what exactly is
        >>the problem you are trying to solve?[/color]
        >
        > There has been an occasional site inconsistency when a user is using a
        > combination of Win98 & MSIE.[/color]

        And what exactly is that "inconsistency" ?
        [color=blue]
        > Never with WinME, Win2K or WinXP.
        > If they are using a combination of Win98 & MSIE, I want to display a
        > message as such.[/color]

        And there lies the problem. The issue of determining browser and OS is
        asked so often that it is addressed directly in this group's FAQ:




        --
        Randy
        comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly

        Comment

        • Mark Preston

          #5
          Re: Determining if user is using Win98 &amp; MSIE

          - Dazed wrote:[color=blue]
          > If a user is using a combination of Win98 & any version of MSIE, I
          > want to display a message.
          > The best that I can do is the following:
          > <?
          > if ((strstr (getenv('HTTP_U SER_AGENT'), 'MSIE')) && (strstr
          > (getenv('HTTP_U SER_AGENT'), '98')))
          > {
          > echo"blah,blah, blah\n";
          > }
          > ?>
          > Is there a better (more foolproof) way?
          >[/color]
          In short, no - there is *no* "foolproof way". For instance, at the
          moment I have my user-agent settings changed to (hopefully) be accurate
          and say I am running Mozilla under WinXP, but quite often to fool just
          such tests as this I change it to claim I am using MSIE and Win2K. More
          often, I simply clear as much as possible of the settings so that it
          tells the server nothing at all.

          Your best bet is to actually think *why* you want that test and consider
          if there is an alternative that is better.

          Comment

          Working...