ASP
  Home arrow ASP arrow Page 3 - Detecting Browser Capabilities With Browse...
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
ASP

Detecting Browser Capabilities With BrowserHawk
By: Annette Tennison
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2002-02-19

    Table of Contents:
  • Detecting Browser Capabilities With BrowserHawk
  • What is BrowserHawk
  • The BrowserHawk application
  • Using BrowserHawk
  • BrowserHawk example
  • Conclusion

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Detecting Browser Capabilities With BrowserHawk - The BrowserHawk application


    (Page 3 of 6 )

    BrowserHawk is installed as a Windows NT service. It comes bundled with the BrowserHawk application, which allows us to view the definitions and properties of each web browser. Each browser definition contains the details of several properties that are unique to that browser, such as its version string and version number. The BrowserHawk application looks like this:

    The BrowserHawk Application

    BrowserHawk comes with browser definitions for 32 different browser types, including those for Netscape, Microsoft, Oracle, Lynx, MCSA Mosaic, WebTV, Konqueror, Mozilla and more. If you so desire, you can also create your own browser definition. This could come in handy if you only require a certain amount of features from a visitor's browser, and not a complete set of features. For example, you might create a new browser type called "MyBrowser". In order for a visitor to view your site, their browser must match all features of the MyBrowser type, which could include support for MSXML, DHTML, JavaScript and cookies.

    So where exactly does BrowserHawk get the details of each visitors browser from? Well, whenever we use our web browser to visit a web site, our browser sends that site a set of details as part of its request header. We can view all of our browser's header variables by iterating through ASP's Request.ServerVariables collection, like this:

    <%

    for each item in Request.ServerVariables

    Response.Write "<b>" & item & ":</b> "

    Response.write Request.ServerVariables(item) & "<br>"

    Next

    %>


    Here's the output from the code above in my browser (I run Internet Explorer 5.5 on a Windows 2000 server):

    My web browsers header details

    I've circled the HTTP_USER_AGENT variable in my screen capture above. BrowserHawk uses this value as the basis for selecting which browser any visitor that comes to our site is using. The "MSIE 5.5" string tells BrowserHawk that I am running Internet Explorer 5.5, and the "Windows NT 5.0" tells BrowserHawk that I'm running Windows 2000.

    If you take the code snippet shown above and run it through your browser, you'll notice several other variables in the list that relate to the details of your web browser, namely HTTPS, PATH_INFO, REMOTE_ADDR, and HTTP_COOKIE.

    Luckily, when we use the BrowserHawk component in our ASP pages, we don't have to analyze the visitors’ browser manually. All we have to do is query a new instance of the BrowserHawk component for the values we're after. We will proceed to do that now.

    More ASP Articles
    More By Annette Tennison


     

    ASP ARTICLES

    - Central Scoreboard with Flash and ASP
    - Calorie Counter Using WAP and ASP
    - Creating PGP-Encrypted E-Mails Using ASP
    - Be My Guest in ASP
    - Session Replacement in ASP
    - Securing ASP Data Access Credentials Using t...
    - The Not So Ordinary Address Book
    - Adding and Displaying Data Easily via ASP an...
    - Sending Email From a Form in ASP
    - Adding Member Services in ASP
    - Removing Unconfirmed Members
    - Trapping HTTP 500.100 - Internal Server Error
    - So Many Rows, So Little Time! - Case Study
    - XDO: An XML Engine Class for Classic ASP
    - Credit Card Fraud Prevention Using ASP and C...







    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT