home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _e838d76c661e85876490e8764ca00619 < prev    next >
Text File  |  2004-06-01  |  2KB  |  67 lines

  1. <%@ LANGUAGE = PerlScript%>
  2. <HTML>
  3. <HEAD>
  4. <!-- 
  5.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  6.     Developed by ActiveState Internet Corp., http://www.ActiveState.com
  7. -->
  8. <TITLE> Browser Capabilities </TITLE>
  9. </HEAD>
  10.  
  11. <BODY>
  12. <BODY BGCOLOR=#FFFFFF>
  13. <!-- 
  14.     ActiveState PerlScript sample 
  15.     PerlScript:  The coolest way to program custom web solutions. 
  16. -->
  17.  
  18. <!-- Masthead -->
  19. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  20. <TR VALIGN=TOP ><TD WIDTH=400>
  21. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  22. </TD></TR></TABLE>
  23.  
  24.  
  25. <%
  26.     $bc = $Server->CreateObject("MSWC.BrowserType"); 
  27.     
  28.     sub tf($) {
  29.         return $_[0] ? 'True' : 'False';
  30.     }
  31. %>
  32.  
  33.  
  34. <H2>Browser Properties</H2><hr>
  35. This example uses the BrowsCap COM component which installs with IIS. To create an instance of a 
  36. COM component, you provide the $Server->CreateObject() method with the progID for the component that you
  37. wish to create.
  38. <BR><BR>
  39. <TABLE BORDER=1>
  40. <TR><TD>Browser Type</TD>        <TD><%= $bc->browser %></TD>
  41. <TR><TD>What Version</TD>        <TD><%= $bc->Version %></TD>
  42. <TR><TD>Major Version</TD>        <TD><%= $bc->majorver %></TD>
  43. <TR><TD>Minor Version</TD>        <TD><%= $bc->minorver %></TD>
  44. <TR><TD>Frames</TD>            <TD><%= tf($bc->Frames) %></TD>
  45. <TR><TD>Tables</TD>            <TD><%= tf($bc->Tables) %></TD>
  46. <TR><TD>Cookies</TD>            <TD><%= tf($bc->cookies) %></TD>
  47. <TR><TD>Background Sounds</TD>        <TD><%= tf($bc->BackgroundSounds) %></TD>
  48. <TR><TD>VBScript</TD>            <TD><%= tf($bc->VBScript) %></TD>
  49. <TR><TD>JavaScript</TD>            <TD><%= tf($bc->Javascript) %></TD>
  50. </TABLE>
  51.  
  52. <!-- +++++++++++++++++++++++++++++++++++++
  53. here is the standard showsource link - 
  54.     Note that PerlScript must be the default language --> <hr>
  55. <%
  56.     $url = $Request->ServerVariables('PATH_INFO')->item;
  57.     $_ = $Request->ServerVariables('PATH_TRANSLATED')->item;
  58.     s/[\/\\](\w*\.asp\Z)//m;
  59.     $params = 'filename='."$1".'&URL='."$url";
  60.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  61. %>
  62. <A HREF="index.htm"> Return </A>
  63. <A HREF="showsource.asp?<%=$params%>">
  64. <h4><i>view the source</i></h4></A>  
  65.  
  66. </BODY>
  67. </HTML>