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.

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 "]

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.