Php cannot get the POST value-php Tutorial

Source: Internet
Author: User
Php cannot obtain the POST value. it is okay to submit a form on a webpage and send it to php.

Now the client is sent in c ++,
@ File_get_contents ('php: // input'); you can get it! Show q = test

However, $ _ POST ['Q'] cannot be obtained. $ _ POST array is empty

The entire request header is:
POST/xxx. php? Ent_id = xxxx & from = xxhttp/1.1
Connection: Keep-Alive
User-agent: Tsl/0.1
Content-Length: 6
Host: 127.0.0.1

(However, the same request can be sent to another server)

Thank you!


Reply to discussion (solution)

Compare browser requests:
More

Content-Type: application/x-www-form-urlencoded
Referer: http: // 127.0.0.1/xxxxx

It should not be related to this...


If you want to get the result using $ _ POST, you must have Content-Type: application/x-www-form-urlencoded.

Reference: http://blog.csdn.net/fdipzone/article/details/40098169

Yes, php $ _ POST requires ContentType to be parsed.

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.