Monday, March 22, 2010

Request.Form in asp

The Request.Form command is used to collect values in a form with method="post".
Information sent from a form with the POST method is invisible to others and has no limits on the amount of information to send.
If a user typed "Bill" and "Gates" in the HTML form above, the URL sent to the server would look like this:
http://www.w3schools.com/simpleform.asp
Assume that "simpleform.asp" contains the following ASP script:

Welcome
<% response.write(request.form("fname")) response.write(" " & request.form("lname")) %>

The browser will display the following in the body of the document:
Welcome Bill Gates

Example:
A form with method="post"
How to interact with the user, with the Request.Form command.




Your name:


<% dim fname fname=Request.Form("fname") If fname<>"" Then
Response.Write("Hello " & fname & "!
")
Response.Write("How are you today?")
End If
%>