The Request object in ASP is simply reading the data of the browser. It is more commonly used:
(1) Obtain the data passed by the client table chapter, format: request.form (variable name), see the following example:
form.asp
Welcome: <%= request.form (name)%>
<%= request.form (sex)%>
<FORMACTION = FORM.ASPMETHOD = Post>
Please enter your name: <inputname = namesize = 20> <p>
Please enter your gender: <selectName = Sex>
<option> Mr.
<option> Ms.
</select>
<p>
<inputtype = submitValue = Submit>
</html>
(2) Get the parameters attached to the website, format: request.querystring (variable name), see the following example:
query.asp
<%
FOREACHITEMINREQUSTRING (ABC)
response.writeitem && nbsp
next
%>
Then enter in the browser website:
http: //locahost/qury.asp? ABC = Songzi & Abc = IS & ABC = BOY
Note: [Red] If it is used to pass the parameters with a form, the medhod should use get. [/Red]
(3) The information of the environment variables of the web server obtains the information, format: request.servervariables (variable name).
Use the following example to display all the content of the attribute:
variables.asp
<%
foreachnameinrequst.servervariables
response.write (<p>)
response.write (<b> & name & </b> :)
Response.write (request.servervariables (name))
%>
More commonly used:
<%A = Request.servervariables (Server_name)%> Host name.
<%= request.servervariables (script_name)%> The virtual address behind the host name.
<%= request.servervariables (local_addr)%> The server address requested.
<%= Request.servervariables (Remote_addr)%> The customer who issues the request requires an IP.
Example: Get your webpage finish URL
http: // <%= request.servervariables (server_name)%> <%= request.servervariables (script_name)%>
(4) Get the cookies in the browser.