The other person said that they use asihttp,post come over.
So can I receive it directly? And how do I detect if I have received data from someone else post or someone else has not sent the data over?
Reply content:
The other person said that they use asihttp,post come over.
So can I receive it directly? And how do I detect if I have received data from someone else post or someone else has not sent the data over?
No, the post is also required to be key value to $_post read.
$raw = file_get_contents ("Php://input", "R");
can accept any form of post data
This is the PHP language and will only be executed if someone submits the post. So you need to know if someone else is post.
If you are wondering how to verify the data submitted by your own app, you can consider using a signature method to validate the data passed over.
As long as the network connection is not a problem, then the app sends the POST request data can be directly obtained in PHP. It is only by judging whether the received data is empty to detect whether or not to pass the data over.
First of all, for the landlord code, I have a few questions:
$json =json_decode[$json, true] this line, what do json_decode do with the array?
Mysql_close this line, without parentheses, should be mysql_close ();
Each other as long as the HTTP POST method post, you can use the post to accept, you can try to use
if (Empty ($_post[' username ')) {
Exit (' username can not is empty ');
}
To do the test.
See Nginx Log, HTTP return status, all line