Getting User Inputs from the Browser- The Request Object/Class
The Request object/class is used to
obtain user inputted values from a form into some sort of ASP processing
While we will focus almost exclusively on the Form collection of the Request class. We present some other collections so that you will be aware they exist, though we will not do anything with them in this course..
|Form||When the form is created with METHOD=POST, use this to get the inputs from a submitted form.|
|QueryString||When the form is created with METHOD=GET, use this to get the inputs to the form. This causes the form input values to be picked up from an HTTP string.|
|ServerVariables||Every time you visit a web page your browser sends a lot of information to the web server and vice-a-versa. This information can be accessed with this collection.|
|Cookies||Through the use of this collection you can store small bits of information on the client's computer. These pieces of information can be used to determine return visitors or customize the content of your web for each visitor.|
|ClientCertificate||Used to retrieve certification fields from a browser request.|
When you want to collect the information from a web form field with a
particular fieldNAME use
This can be used to collect the inputs from text boxes, list boxes, check boxes and radio buttons. The one thing that I seem to too often do is forget to put quotation marks around the filedNAME. The first thing we want to do is modify the YouDidIt.asp we developed in the last web page to collect the values you type in and feed them back so you can see them. This will result in a use of both Request.Form and Response.Write, two of major operational tools for developing ASP web based user interactions.
So you want to copy the following code into your YouDidIt.asp and upload it back to your root web. CaveatEmptor.asp will stay the same.
The meaning of the code will be discussed in class.
Now you would get the following two screens on the web if you filled in the same entries.
|After sending this on you should see the following.|
|Now you are ready to complete the Login.asp, which is really quite a bit simpler than what we have just done. This will be done in the next web page.|