开发者

php script to echo a post

开发者 https://www.devze.com 2023-01-16 09:27 出处:网络
Could someone help with a simple PHP script to echo the whole message received with an HTTPPOST. I am sending a string from an android app using HTTPPOST and would like to receive 开发者_运维问答as a

Could someone help with a simple PHP script to echo the whole message received with an HTTPPOST.

I am sending a string from an android app using HTTPPOST and would like to receive 开发者_运维问答as a response the message received by the POST at the server.

The script that I am using will only echo name value pairs

echo $_POST('data')

works when I post form data, but have not figured out how to echo a string.

Thanks


echo '<pre>',print_r($_POST),'</pre>';


Raw:

echo file_get_contents('php://input');

Possibly more easily parseble:

echo json_encode($_POST);
echo serialize($_POST);

For debugging purposes:

var_dump($_POST);
0

精彩评论

暂无评论...
验证码 换一张
取 消