Para começar a informação do usuário, o objeto do pedido do ASP é usado.
Objeto do pedido
É chamado um pedido quando um browser pede uma página de um usuário. Para começar a informação do usuário, o objeto do pedido do ASP é usado. Seus coleções, propriedades, e métodos são descritos abaixo:
Coleções:
Collection
Description
ClientCertificate
Contains all the field values stored in the client certificate
Cookies
Contains all the cookie values sent in a HTTP request
Form
Contains all the form (input) values from a form that uses the post method
QueryString
Contains all the variable values in a HTTP query string
ServerVariables
Contains all the server variable values
Propriedades
Property
Description
TotalBytes
Returns the total number of bytes the client sent in the body of the request
Métodos
Method
Description
BinaryRead
Retrieves the data sent to the server from the client as part of a post request and stores it in a safe array
Emitir a informação da pergunta quando um usuário estala sobre uma ligação usando QueryString
<html>
<body>
<form action="demo_simpleform.asp" method="post">
Your name: <input type="text" name="fname" size="20" />
<input type="submit" value="Submit" />
</form>
<%
dim fname
fname=Request.Form("fname")
If fname<>"" Then
Response.Write("Hello " & fname & "!<br />")
Response.Write("How are you today?")
End If
%>
</body>
</html>
O/P:
Your Name:
Results:
Hello Ravi!
How are you today?
Criar um bolinho bem-vindo
<%
dim numvisits
response.cookies("NumVisits").Expires=date+365
numvisits=request.cookies("NumVisits")
if numvisits="" then
response.cookies("NumVisits")=1
response.write("Welcome! This is the first time you are visiting this
Web page.")
else
response.cookies("NumVisits")=numvisits+1
response.write("You have visited this ")
response.write("Web page " & numvisits)
if numvisits=1 then
response.write " time before!"
else
response.write " times before!"
end if
end if
%>
<html>
<body>
</body>
</html>
O/P:
Welcome!
This is the first time you are visiting this Web page.
Formulário do início de uma sessão usando a coleção do formulário