|
|
| FORMS IN ASP |
|
I will in this tutorial show you how to use forms in asp. Forms is used when
you want to pass information either over to another site, into a textfile, database, etc.
|
The Form
|
You put your form around the variables you want to pass. In this example I
will use a textbox that you can pass on. It is the submit input type shown below that
trigger the form. The action here is sat the newpage.asp. So when you press the
submit button you will go to the newpage.asp and the values written in
the textfield is past along to this site.
The method has two alternative: post and get. The post
method is more secure because the user cannot see the variable passed along,
while the get-method sends the variable visible in the adresse bar. So if
you will make a login system, use the post method :)
|
Getting the data from the form
|
|
In the form above, we pass the content of the textfile to the newpage.asp.
We get hold since we use the post method, we get the variable with
Request.Form("txtMyField") in the newpage.asp file.
|
|
|
|
If you want to use the get method, simply change the method="get" in the form
and Request.Form("txtMyField").
|
Download the Source for this tutorial.
|
Category
|
Programming with ASP
|
|
Author
|
Tommy Johannessen
|
|
|
|