SQL PHP HTML ASP JavaScript articles and free scripts to download
 

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.
Further readings
Form Get method to collect data in ASP script
Form Post method to collect data
Difference between GET and Post method of form submission
Different ways of passing variables with data between pages
Form handling in ASP
Collecting checked radio button value of a HTML form in ASP
Collecting checkbox button value of a HTML form in ASP
 
Scripts
PHP
JavaScript
All ASP Tutorials
Popular Tutorials
Managing two drop downs
ASP Tutorials
Date and time
Declaring array
Form in ASP
Server.MapPath
Date Time & MSSQL
Select Query
File System Object
Subscribe
Submit your email address and receive article and product notifications. Your email is safe with us.