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

  1.  <% If Request("DontFrame")<>1 Then Response.Redirect "/iissamples/sdk/asp/docs/SampFram.asp?ovfile=/iishelp/iis/htm/sdk/samp3oz8.asp&srcfile=Interaction/Form" %>
  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 POST</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_post"></a>User Form Input with POST</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>POST</b> method attribute indicates that information from the form will be passed to the processing script or program through a separate HTTP connection. The processing script or program can parse the information and 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>POST</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. This sample creates a small form with 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.Forms</b> collection is accessed to get 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 no form information was available to pass to this script when it started, and ASP ignores searches of <b>Request.Forms</b> for information that does not exist. However, if you press the Submit button, the page is reloaded and the information you entered into the text boxes is available to the script. </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.