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>
form components
</form>

In POST method data can be collected by using request object of ASP. Here is the code

Dim my_var
my_var=Request("city")

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
Response.Write var_get & " = " & Request.Form(var_get) & "<br>"
Next

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.

Be the first to post comment on this article :

plus2net.com




Post your comments , suggestion , error , requirements etc here .




We use cookies to improve your browsing experience. . Learn more
HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
©2000-2019 plus2net.com All rights reserved worldwide Privacy Policy Disclaimer