Solved

Code to check web Browser.

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

Expert Comment

by:BrianGEFF719
ID: 10779754
you can do:

Request.ServerVariables("HTTP_USER_AGENT")



so therefore:

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





Good Luck
-Brian
0
 
LVL 19

Accepted Solution

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


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




-Brian
0
 

Author Comment

by:eteran
ID: 10779797
okay now my question to you is how do I make it check the version
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 19

Expert Comment

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



-Brian
0
 
LVL 20

Expert Comment

by:jitganguly
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  
%>

<%else
'NETSCAPE CODE
%>

<%end if%>
0
 
LVL 12

Expert Comment

by:kingsfan76
ID: 10780093
http://www.4guysfromrolla.com/webtech/121400-1.2.shtml

<%
  '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

http://support.microsoft.com/default.aspx?scid=kb;en-us;311227

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

Expert Comment

by:TheKenman
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):

http://www.dynamicdrive.com/dynamicindex9/browsersniffer.htm

Also http://webreference.com/tools/browser/javascript.html to be used with: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
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 …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

770 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