Post method of form data handling by request object
In POST method of sending form data to processing page is more used than GET method. In POST method data entered inside the form is passed to action page by using HTTP header. The main difference visible here is that data is not passed through URL as a query string in user address bar (like GET method). Here is the form code for method object.
<form name=f1 method=post action=file_name.asp>
In POST method data can be collected by using request object of ASP. Here is the code
… form components
Here my_var is a declared variable and city is the form component name where city name is entered by the user. Now the value entered by the user is available at variable my_var
Like in the Get method we can also loop through and display all the name value pairs associated in POST method of form submission. Here is the code
For Each var_get in Request.Form
But this is not a good practice of allowing all variables to initialize as this can be exploited to pass unwanted variables into the script.
Response.Write var_get & " = " & Request.Form(var_get) & "<br>"
This article is written by plus2net.com team.
Be the first to post comment on this article :