Code to check web Browser.

Posted on 2004-04-07
Last Modified: 2008-03-10
Is there a code that can check which webbrowser the computer is useing
Question by:eteran
LVL 19

Expert Comment

ID: 10779754
you can do:


so therefore:

document.write "You are using: " & Request.ServerVariables("HTTP_USER_AGENT")

Good Luck
LVL 19

Accepted Solution

BrianGEFF719 earned 500 total points
ID: 10779768
Sorry you should do:

response.write "You are using: " & Request.ServerVariables("HTTP_USER_AGENT")


Author Comment

ID: 10779797
okay now my question to you is how do I make it check the version
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

LVL 19

Expert Comment

ID: 10779805
HTTP_USER_AGENT should contain the Version number as well.

LVL 20

Expert Comment

ID: 10779862
Here is the code

    myUA = Request.ServerVariables("http_user_agent")
    ua = lcase(myUA)
    ie4 = instr(ua,"msie 4")
    ie5 = instr(ua,"msie 5")
    ie6 = instr(ua,"msie 6")

    if ie4>0 or ie5>0 or ie6> 0 then  ' It is IE 4 or IE 5 or IE 6
    'IE Code  


<%end if%>
LVL 12

Expert Comment

ID: 10780093

  'Create an instance of the Browser Capabilities Component
  Dim objBC
  Set objBC = Server.CreateObject("MSWC.BrowserType")
<b>Your browser:</b> <%=objBC.Browser%><br>
<b>Browser version:</b> <%=objBC.Version%><br>
<b>Support Frames?</B> <%=objBC.Frames%><br>

to use this object, make sure you have your Browscap.ini updated, otherwise it can't detectIE6.0;en-us;311227

that is the link to add IE 6 support the Browscap.ini file

Expert Comment

ID: 10780557
Here's one of the best javascript examples to get detailed version info (or if you need to check the version client-side):

Also to be used with:

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

821 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question