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

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp8050.asp&srcfile=Interaction/QueryString" %>
  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>User Form Input with GET</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="_user_form_input_with_get"></a>User Form Input with GET</h3>
  30. <p>
  31. The most basic form of interactivity on the Web has been, and probably will continue to be for some time to come, the HTML form. It is important to note that ASP does not replace forms, but rather enhances them, and makes them easier for you to implement and manage. </p>
  32. <p>
  33. The HTML <FORM> tag specifies what method the form will use to convey information to the processing script. The <b>GET</b> method attribute indicates that forms are used to pass parameters to the processing script or program by appending the parameters to the URL. The processing script or program can then parse out the individual values appended to the URL request, do whatever task is required, and return output to the client browser. </p>
  34. <p>
  35. This example demonstrates how to implement a simple form using the HTML <b>GET</b> method attribute, as well as one key benefit of creating forms with ASP: the ability to combine the form and the actual processing code into the same file. The sample creates a small form is that contains two text input boxes, one for the user's first name (<i>fname</i>) and one for his or her last name (<i>lname</i>). The <b>Request.QueryString</b> collection is accessed to obtain the value of the <i>fname</i> and <i>lname</i> variables from the request, and the results are displayed at the bottom of the page.</p>
  36. <p>
  37. The first time you run this script, no text will be displayed below the horizontal line. This is because the script executes without any query string, and ASP ignores accesses to <b>Request.QueryString</b> for query string elements that do not exist. However, if you press the Submit button, the page is reloaded, this time with a query string that passes the information that you entered into the text boxes. The second time around, the script displays your name.</p>
  38. <hr class="iis" size="1">
  39. <p align="center"><em><a href="/iishelp/common/colegal.htm">© 1997 by Microsoft Corporation. All rights reserved.</a></em></p>
  40. </BODY>
  41. </HTML>
  42.