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
Reply to discussion (solution)
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
Actually, this could have been replaced with file_get_contents (' Php://input ').
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
My source code method is this:
Public Function responsemsg ()
{
$POSTSTR = $GLOBALS ["Http_raw_post_data"];
if (!empty ($POSTSTR)) {
$POSTOBJ = simplexml_load_string ($HTTP _raw_post_data, ' simplexmlelement ', libxml_nocdata);
$fromUsername = $POSTOBJ->fromusername;
$toUsername = $POSTOBJ->tousername;
$keyword = Trim ($postObj->content);
$time = time ();
$TEXTTPL = "
%s
%s
%s
%s
%s
0
";
if ($keyword = = "?" | | $keyword = = "? ")
{
$msgType = "text";
$CONTENTSTR = Date ("Y-m-d h:i:s", Time ());
$RESULTSTR = sprintf ($TEXTTPL, $fromUsername, $toUsername, $time, $msgType, $CONTENTSTR);
Echo $resultStr;
}
}else{
echo "";
Exit
}
}
Help me look.
Public Function responsemsg () {
if (! isset ($GLOBALS ["Http_raw_post_data"])) return ';
$POSTSTR = $GLOBALS ["Http_raw_post_data"];
Public Function responsemsg () {
if (! isset ($GLOBALS ["Http_raw_post_data"])) return ';
$POSTSTR = $GLOBALS ["Http_raw_post_data"];
I tried it this way, so I return directly. Then the following code is not implemented: I don't know.
Direct run, of course, is to return directly
If post is submitted, it will be.
Direct run, of course, is to return directly
If post is submitted, it will be.
Maybe I'm not very good, so I'm learning, thank you.
You have to write a form when you test.
This is the code inside the interface I also appeared this problem landlord solved it