Recommended: Web page template: ASP built-in object Request Starting from this article, the author starts with ASP built-in objects and analyzes the features and methods of the six built-in objects and various components of ASP for you in detail. Before officially starting to learn the built-in objects and components of ASP, let us first understand some basic concepts, which will be of great help to your future learning. Please see the table below: What is an object? It does not refer to the male or female companion you are in love. On-site
The difference between getting post submission form in the asp tutorial
There are 5 differences between Get and Post methods
1. Get is to get data from the server, and post is to transfer data to the server.
2. get adds the parameter data queue to the URL referred to by the ACTION attribute of the submitted form. The value corresponds to each field in the form one by one, and can be seen in the URL. Post is to pass each field in the form and its contents in the HTML HEADER through the HTTP post mechanism to transmit it to the URL address referred to by the ACTION attribute. Users cannot see this process.
3. For the get method, the server uses Request.QueryString to get the value of the variable. For the post method, the server uses Request.Form to get the submitted data.
4. The amount of data transmitted by get is small and cannot be greater than 2KB. The amount of data transmitted by post is large and is generally defaulted to be unrestricted. But theoretically, the maximum amount in IIS4 is 80KB and 100KB in IIS5.
5. Get security is very low and post security is high.
HTTP request: The difference between GET and POST methods
HTTP defines different ways of interacting with the server, the most basic methods are GET and POST. In fact, GET works for most requests, while POST is reserved for updating the site only. According to the HTTP specification, GET is used for information acquisition and should be safe and idempotent. Safe means that the operation is used to acquire information rather than modify information. In other words, GET requests should generally not have side effects. Idespicable means that multiple requests to the same URL should return the same result. The complete definition is not as strict as it seems. Fundamentally, the goal is that when a user opens a link, she can be convinced that the resource has not changed from her own perspective. For example, the front pages of news sites are constantly updated. Although the second request returns a different batch of news, the operation is still considered safe and idempotent because it always returns the current news. vice versa. POST requests are not that easy. POST indicates a request that may change the resource on the server. Still taking the news site as an example, readers' annotations for the article should be implemented through a POST request, because the site is already different after the annotation is submitted (for example, an annotation appears below the article);
When FORM commits, if the Method is not specified, it defaults to GET request. The data submitted in the Form will be appended after the url, separate from the url. Alphanumeric characters are sent as-is, but spaces are converted to + signs, and other symbols are converted to %XX, where XX is the ASCII (or ISO Latin-1) value of the symbol in hexadecimal. The data submitted by the GET request is placed in the HTTP request protocol header, while the data submitted by POST is placed in the entity data; the data submitted by the GET method can only have a maximum of 1024 bytes, while POST has no such limit.
What is the difference between using post and get in form
In Form, you can use post or get. They are all legal values of method. However, there are at least two differences in use of post and get methods:
1. The Get method passes user input through URL request. The Post method is in another form.
2. When submitting in Get mode, you need to use Request.QueryString to get the value of the variable. When submitting in Post mode, you must access the submitted content through Request.Form.
Take a closer look at the code below. You can run it to experience it:
Code
The following is the quoted content:
<!--The two Form only have different Method attributes-->
<FORM ACTION=getpost.php tutorial METHOD=get>
<INPUT TYPE=text NAME=Text VALUE=Hello World></INPUT>
<INPUT TYPE=submit VALUE=Method=Get></INPUT>
</FORM>
<BR>
<FORM ACTION=getpost.php METHOD=post>
<INPUT TYPE=text NAME=Text VALUE=Hello World></INPUT>
<INPUT TYPE=submit VALUE=Method=Post></INPUT>
</FORM>
<BR>
<BR>
<? If Request.QueryString(Text) <> Then ?>
The string passed through the get method is: <B><?= Request.QueryString(Text) ?></B><BR>
<? End If ?>
<? If Request.Form(Text) <> Then ?>
The string passed through the Post method is: <B><?= Request.Form(Text) ?></B><BR>
<? End If ?>
illustrate
Save the above code as getpost.asp, then run, first test the post method. At this time, the browser's url has not changed much, and the returned result is:
The string passed through the Post method is: Hello World
Then test submit using the get method. Please note that the browser's url becomes:
http://localhost/general/form/getpost.php?Text=Hello+World
And the result returned is:
The string passed through the get method is: Hello World
Finally, submit it through the post method, and the browser's url is still:
http://localhost/general/form/getpost.php?Text=Hello+World
And the result returned becomes:
The string passed through the get method is: Hello World
The string passed through the Post method is: Hello World
hint
Submitting data through get methods may bring security issues. For example, a login page. When submitting data through the get method, the username and password will appear on the URL. if:
1. The login page can be cached by the browser;
2. Others can access the customer's machine.
Then, others can read the account and password of this customer from the browser's history. Therefore, in some cases, the get method can bring serious security issues.
suggestion
In Form, it is recommended to use the post method.
Share: Detailed explanation of the use of open method of xmlhttp open Create a new http request and specify the method, URL and verification information syntax of this request oXMLHttpRequest.open(bstrMethod, bstrUrl, varAsync, bstrUser, bstrPassword); Parameters bstrMethod http methods, such as: POST, GET, PUT and PROPFIND. Insensitive case. The URL address requested by bstrUrl can be absolutely