When you submit data by using the form's Get method, the data in the form is saved in the QueryString collection of the Request object. In addition to reading the parameters passed by a Form object, the QueryString collection can also pass parameters by reading the parameter values in the HTTP query string. The syntax format for passing data using the QueryString collection is as follows:
Request.Querstring (变量名) [(索引值)|.变量的个数]
Note: "Variable" specifies the name of the variable to retrieve in the HTTP query string; Index value is used to retrieve one of several variable values; The value of the variable in the HTTP query string is determined by a question mark (?). ) Specifies the value that follows.
First, use the QueryString collection to read the form's parameters
Below is a list of basic situations that a recruiter needs to be filled out by a recruiter. The code for submitting the form is as follows (file name: 4-3e.htm):
<body>
<p align=center> input Data form
<form action= "4-3e.asp" method= "Get" >
<table Align=center border=1>
<tr valign=baseline>
<td> Name: <input type= "text" name= "name" size=8>
<td> Sex: Male <input type= "Radio" Name= "surname" value= "male" checked>
Female <input type= "Radio" Name= "surname" value= "female" >
<td> Password: <input type= "Password" name= "password" size=12>
<TR><TD colspan=3> majored in science
<input type= "Checkbox" name= "Learning major" value= "Chinese" > Chinese
<input type= "Checkbox" name= "Learning major" value= "Japanese" > Japanese
<input type= "Checkbox" name= "professional" value= "Spanish" > Spanish
<input type= "Checkbox" name= "Learning Major" value= "English" > English
<input type= "Checkbox" name= "professional" value= "German" > German
<tr><td> Specialty:<br>
<select name= "speciality" style= "width:200px" size=4>
<option value= "Social" > Social
<option value= "Computer" > Computer
<option value= "Sports" > Sports
<option value= "Literary hobby" selected> literary hobby
<option value= "good management" > good at Management
</Select>
<TD colspan=2> Life Motto:<br>
<textarea name= "Life motto is:" Cols=40 rows=4></textarea>
</table>
<p align=center><input type= "Submit" value= "submitted" >
<input type= "Reset" value= "Rewrite" >
</form>
</body>
The code to invoke the form handler is as follows: (file name: 4-3a.asp)
<body>
<center>
request 对象的form 集合示例<p>
<p><font color="red">下面是您所填写的基本信息,请确定是否正确。<p>
<%
Response.write("您的姓名是:" & Request.form("xm") & "<p>")
Response.write("您的性别是:" & Request.form("xb") & "<p>")
Response.write("您的密码是:" & Request.form("mm") & "<p>")
Response.write("您所学专业是:" & Request.form("ah") & "<p>")
Response.write("您的特长是:" & Request.form("xl") & "<p>")
Response.write("您的格言是:")
Response.write Request.form("adage") & "<p>"
%>
这些信息对吗?
<a href="4-3a.htm">如不对,返回</a>**||**<a href="4-3-2.asp">请点这里返回到教材</a></p>
<center>
</body>