notice:undefined Index:http_raw_post_data in D:program files solution in PHP

Source: Internet
Author: User
notice:undefined index:http_raw_post_data in D:\Program Files appears in PHP
I wrote it in PHP:

$POSTSTR = $GLOBALS ["Http_raw_post_data"];
After running
notice:undefined Index:http_raw_post_data in D:\Program files\phpenv\phpdemo\shm_php01\shm01.php on line 47 appears in PHP

Then I removed the Always_populate_raw_post_data = on comment from the php.ini file.

; Always populate the $HTTP _raw_post_data variable. PHP ' s default behavior is
; To disable this feature. If post reading is disabled through
; Enable_post_data_reading, $HTTP _raw_post_data is *not* populated.
; Http://php.net/always-populate-raw-post-data
Always_populate_raw_post_data = On

Restart is still not used, ask the man to guide the maze
------to solve the idea----------------------
Always_populate_raw_post_data = On

When submitted as post, available
echo $HTTP _raw_post_data;
Print out the submitted unformatted string.

Of course not when the post is submitted, it is undefined
------to solve the idea----------------------
Actually, this could have been replaced with file_get_contents (' Php://input ').
------to solve the idea----------------------
Direct run, of course, is to return directly
If post is submitted, it will be.
------to solve the idea----------------------
You have to write a form when you test.
  • 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.