Detecting Firefox with request.servervariables("HTTP_USER_AGENT")

S

Sharon

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.
 
A

Adrienne

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.
 
D

Dave Anderson

Sharon said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top