The following is my program: after sending a request package, I have $ HTTP_RAW_POST_DATA in tmp.txt, but the page displays parsexmlstringerror! Go back and check the code. a warning is displayed on $ HTTP_RAW_POST_DATA: Undefinedvariable & #39; $ HTTP_RAW_POST_DATA. on the Internet, I checked that it was changed to php. ini, I checked php in Windows. ini, indeed "always_populate_raw_post_dataOn" (is it code-based xmlphp data?
The following is my program:
After sending a request packet, I found $ HTTP_RAW_POST_DATA in tmp.txt, but the page displays parse xml string error! Go back and check the code. a warning is displayed on $ HTTP_RAW_POST_DATA: Undefined variable '$ HTTP_RAW_POST_DATA. on the Internet, check whether it is php. ini, I checked php in Windows. ini, it is indeed "always_populate_raw_post_data = On" (isn't it a semicolon or a comment? Is it necessary to remove the semicolon? I can't even try it), but it doesn't work.
After refreshing the web page, the value in tmp.txtbecomes null, and the request is sent again with data in tmp.txt. However, the web page cannot be displayed and must be refreshed. Once refreshed, T ^ T is used. could you tell me how to change it? thank you?
**
// Obtain POST data and GET data (use Fiddler to send a POST request packet to test2.php)
File_put_contents ("D: \ Program Files (x86) \ AppServ \ tmp.txt", var_export ($ _ GET, true), FILE_APPEND );
Echo"
";
File_put_contents ("D: \ Program Files (x86) \ AppServ \ tmp.txt", "\ n", FILE_APPEND );
Echo"
";
File_put_contents ("D: \ Program Files (x86) \ AppServ \ tmp.txt", var_export ($ HTTP_RAW_POST_DATA, true), FILE_APPEND );
// Parse $ HTTP_RAW_POST_DATA and output the parsed data
$ PostXmlStr = $ HTTP_RAW_POST_DATA;
$ XmlObj = simplexml_load_string ($ postXmlStr );
If (false ===$ xmlObj)
{
Echo "parse xml string error! \ N ";
Exit (0 );
}
$ ToUser = $ xmlObj-> ToUserName;
Echo "to User:". $ toUser. "\ n ";
?>