Differences between $ _ REQUEST, $ _ POST, and $ _ GET in php and their contact summary
Source: Internet
Author: User
In php, $ _ request, $ _ post, and $ _ get are used to accept form data. What are the differences between them and when to use the best form data.
1. $ _ REQUEST
In php, $ _ REQUEST can be used to obtain data submitted by the POST and GET methods, but the speed is relatively slow.
2. $ _ GET
Used to obtain the data submitted by the browser through the GET method. The GET method adds the parameter data to the URL referred to by the action attribute of the submitted Form. the values correspond to each field in the form one by one and can be seen in the URL, but the following disadvantages exist:
1. poor security, which can be seen in the URL
2. the transfer data volume is small and cannot exceed 2 kB.
3. $ _ POST
Used to obtain data submitted by the browser through the POST method. The POST method uses the http post mechanism to place all fields in the form in the http header and send them to the URL address referred to by the action attribute. you cannot see this process. The submitted size is generally unlimited, but it is slightly different depending on the server. Security is slightly higher than the _ GET method
4. differences and connections between $ _ REQUEST, $ _ POST, and $ _ GET
$ _ REQUEST ["parameter"] has the function of $ _ POST ["parameter"] $ _ GET ["parameter, however, $ _ REQUEST ["parameter"] is slow. All data submitted through the post and get methods can be obtained through the $ _ REQUEST array ["parameter "]
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.