Web-is it possible for php to directly retrieve the app as long as it uses post?

Source: Internet
Author: User
The other party said they used asihttp and post. So can I receive it directly? Also, how can I check whether I have received the data from someone else's post or whether someone else has sent the data? {Code...} the other party said they were using asihttp and post.

So can I receive it directly? Also, how can I check whether I have received the data from someone else's post or whether someone else has sent the data?


  

Reply content:

The other party said they used asihttp and post.

So can I receive it directly? Also, how can I check whether I have received the data from someone else's post or whether someone else has sent the data?


  

No. The key-value pair of the key value must be post to read $ _ POST.
$ Raw = file_get_contents ("php: // input", "r ");

Accept any form of post data

This is the php language. It will be executed only when a post is submitted. So you need to know if someone else is post.
If you want to know how to verify whether the data submitted by your app is correct, you can use the signature method to verify the data.

As long as there is no problem with the network connection, the data sent by the app to send the post request can be directly obtained in php. Check whether the received data is transmitted by checking whether the received data is null.

First, I have a few questions about the landlord's code:
$ Json = json_decode [$ json, true]. What is json_decode for the array?
Mysql_close ();

As long as the other party uses the post method of http, you can accept it with post. You can try to use
If (empty ($ _ POST ['username']) {
Exit ('username can not be empty ');
}
For testing.

View nginx logs and return http status.

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.