通过HttpSendRequest发送PHP网站中的原始数据 [英] GET raw data in PHP website sent through HttpSendRequest
本文介绍了通过HttpSendRequest发送PHP网站中的原始数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我通过以下代码将文本发送到服务器端运行的php网站:
I am sending a text via following code to a php website running in server side:
bRet = HttpSendRequest(hInternetOpen,NULL,0, LPVOID)cstrData.c_str(),dwDataLen);
其中cstrData是发送数据。(发送到http://10.195.12.99/Sample.php [ ^ ]
我想在这个php网站上捕获这些数据。将要捕获的PHP脚本是什么从客户端发布数据?这里Sample.php只是一个简单的php文件,除了echo之外什么都没有。
我该怎么做?
请帮忙。
谢谢
where cstrData is sent data.(Sending this to http://10.195.12.99/Sample.php[^]
I want to catch this data in this php site. What will be the PHP script to catch posted data from client? here Sample.php is just a simple php file, nothing is there except echo.
How can I do this?
Please help.
Thanks
推荐答案
在这里查看: http://php.net/manual/en/reserved.variables。 httprawpostdata.php [ ^ ]。
Look here: http://php.net/manual/en/reserved.variables.httprawpostdata.php[^].
<?php
postdata = file_get_contents( php:// input); ??>
postdata = file_get_contents("php://input"); ??>
这样你可以访问整个请求体。
This way you can access the whole request body.
/ *检查数据到达* /
if(isset(
/* Check arrival of data */
if(isset(
这篇关于通过HttpSendRequest发送PHP网站中的原始数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文