Detecting Firefox with request.servervariables("HTTP_USER_AGENT")

Discussion in 'ASP General' started by Sharon, Jun 7, 2005.

  1. Sharon

    Sharon Guest

    Can I use request.servervariables("HTTP_USER_AGENT") to determine if the
    user has Firefox or Internet Explorer? Is the return string differentiated
    enough?

    Thanks for any input.
     
    Sharon, Jun 7, 2005
    #1
    1. Advertising

  2. Sharon

    Adrienne Guest

    Gazing into my crystal ball I observed "Sharon" <> writing
    in news::

    > Can I use request.servervariables("HTTP_USER_AGENT") to determine if
    > the user has Firefox or Internet Explorer? Is the return string
    > differentiated enough?
    >
    > Thanks for any input.
    >
    >
    >
    >


    Quite different.
    For IE: Mozilla/4.0 (compatible; MSIE 6.0 ...) ...being other things the
    UA might have.
    For Firefox: Gecko/20050511 Firefox/1.0.4
    For Opera as Mozilla: Mozilla/5.0 (...) Opera 8.0 ... being OS
    For Opera as IE: Mozilla/4.0 (compatible; MSIE 6.0;...) Opera 8.0
    For Opera as Opera: Opera/8.0 (...)

    The real question is, why do you need the UA string? Try not to do too
    much browser sniffing because A) browsers can lie, like Opera; B) the UA
    string can change; C) there are a lot of browsers out there and its
    insane to try to test for all of them.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Jun 7, 2005
    #2
    1. Advertising

  3. Sharon wrote:
    > Can I use request.servervariables("HTTP_USER_AGENT") to determine
    > if the user has...


    No. I can direct my browser to send any UA string I want.



    --
    Dave Anderson

    Unsolicited commercial email will be read at a cost of $500 per message. Use
    of this email address implies consent to these terms. Please do not contact
    me directly or ask me to contact you directly for assistance. If your
    question is worth asking, it's worth posting.
     
    Dave Anderson, Jun 7, 2005
    #3
    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. Elliot M. Rodriguez
    Replies:
    1
    Views:
    644
    bruce barker
    Feb 12, 2004
  2. Philip Townsend

    detecting plugins / ServerVariables

    Philip Townsend, Feb 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    308
    Eric Lawrence [MSFT]
    Feb 22, 2004
  3. =?Utf-8?B?aG4=?=
    Replies:
    3
    Views:
    25,468
    John Saunders
    Dec 16, 2004
  4. Gordan
    Replies:
    3
    Views:
    2,261
    Toby A Inkster
    Nov 25, 2003
  5. bitbucket
    Replies:
    3
    Views:
    616
    bitbucket
    Sep 4, 2008
Loading...

Share This Page