home *** CD-ROM | disk | FTP | other *** search
/ Chip 1998 February / CHIP_2_98.iso / software / pelne / optionp / iis4_06.cab / samp9aur.asp < prev    next >
Text File  |  1997-10-15  |  2KB  |  38 lines

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp9aur.asp&srcfile=Interaction/ServerVariables" %>
  2. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  3. <HTML>
  4. <HEAD>
  5. <META HTTP-EQUIV="Content-Type" Content="text-html; charset=Windows-1252">
  6. <title>HTTP Server Variables</title>
  7. <script language="JavaScript">
  8.  
  9.     szNavVersion = navigator.appVersion
  10.  
  11.     if (navigator.appName == "Microsoft Internet Explorer") {
  12.     if (szNavVersion.indexOf ("4.") >= 0) {
  13.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  14.     } else {
  15.         document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  16.     }
  17.     }
  18.     else if (navigator.appName == "Netscape") {
  19.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie4.css">');
  20.     }
  21.     else {
  22.     document.writeln('<link rel="stylesheet" type="text/css" href="/iishelp/common/spidie3.css">');
  23.     }
  24.  
  25. </script>
  26. <META NAME="DESCRIPTION" CONTENT="Internet Information Server reference information"></HEAD>
  27. <BODY BGCOLOR=#FFFFFF TEXT=#000000>
  28. <font face="Verdana, Arial, Helvetica">
  29. <h3><a name="_http_server_variables"></a>HTTP Server Variables</h3>
  30. <p>
  31. Each HTTP transaction that takes place between a client browser and a server involves the exchange of a great deal of potentially useful information, much of which is not obvious to the casual user. This sample demonstrates one method by which you can access this information, by accessing server variables. Using server variables, you can, for instance, determine the server's name with the SERVER_NAME variable, or the HTTP headers with the ALL_HTTP variable.</p>
  32. <p>
  33. The sample's structure is simple: form a two-column table, and fill each table row with a <i>name, value</i> variable pair. Each individual server variable is retrieved by using the name as a key, such as <b>Request.ServerVariables(</b>"ALL_HTTP"<b>)</b>. In addition, since <b>ServerVariables</b> is a collection, you can use a <b>For Each ... Next</b> loop to iterate through all variables found in the collection. </p>
  34. <hr class="iis" size="1">
  35. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  36. </BODY>
  37. </HTML>
  38.