Difference between php $ _ POST and php: // input

Source: Internet
Author: User
: This article mainly introduces the differences between php $ _ POST and php: input. For more information about PHP tutorials, see. 1. $ _ POST and php Tutorial: input can get the value, $ HTTP_RAW_POST_DATA is empty $ _ POST organizes the submitted data in an associated array and encodes it, such as urldecode, even php: input can be converted to code. This function can be used to obtain the original POST

2. using the curl post method to transmit json is unacceptable in our conventional $ _ POST method. one method is acceptable, that is, a layer of array outside the json data layer, use file_get_contents ("php: // input") to receive post data, without the need to package array

3. simulate a form to see the following:

Post. php


Php: // input allows reading original POST data. Compared with $ HTTP_RAW_POST_DATA, it puts less pressure on the memory and does not require any special php. ini settings. Php: // input cannot be used for enctype = "multipart/form-data ".


Php $ _ POST

The $ _ POST variable is an array with the variable name and value sent by the http post method.

The $ _ POST variable is used to collect the values in the form from method = "post. The information sent from a form with the POST method is invisible to anyone (not displayed in the address bar of the browser) and there is no limit on the amount of information sent.

Html

Welcome. php

Welcome .

You are Years old!

Variables sent through http post are not displayed in the URL.
Variable has no length limit


The above introduces the differences between php $ _ POST and php: // input, including some content, and hope to help those who are interested in PHP tutorials.

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.