i will be sending a POST request to login.php on my server from an iphone app over HTTPS. The POST is created using NSMutableURLRequest. Is there an example of a PHP script to process this POST on my server. The POST isn't sent as a form as such , anyway not that i think it is. Not sure how NSMutableURLRequest formats this. I just need to know how to access the POST data on the server with the php script.
All the examples ive seen regarding php scripts processing POSTS seem to be do with forms. So how do i proces开发者_StackOverflow中文版s this? Any links etc most welcome.
Thanks
You can access any POST data via the $_POST
array in PHP:
An associative array of variables passed to the current script via the HTTP POST method.
The HTTP POST method itself has nothing to do with forms (it is just often used with forms). It is another way to transmit data, compared to GET.
With GET, the parameters are appended to the URL, with POST, they are in the HTTP message body.
Make yourself familiar with HTTP.
精彩评论