Using the GET method, the input values from the form are sent as part of the URL, and saved in the Request.QueryString
variable of an associative array.
The advantage of the GET method is the page can be retrieved again by entering the URL.
For example, after submit the keywords: PHP and MySQL to the Yahoo, the URL is changed to the following string:
http://search.yahoo.com/search?p=PHP+MySQL&ei=UTF-8
and the variable values are
Request.QueryString["p"]
= “PHP MySQL” and
Request.QueryString["ei"]
= “UTF-8”
if the Yahoo Search uses ASP.NET.
The code ‘+’ is for the space ‘ ’.
However, the GET method is not a secure method of sending data since the data is passed through as part of the URL, which will show up in the web server’s logfile.
The following demonstration shows an example of the GET method assuming
- Submit Button ID:
act
,
- Input1 TextBox ID:
input1
, and
- Input2 TextBox ID:
input2
.