用网页 提交表单,发到php 完全可以没问题。
现在 客户端用c++ 发过去,
@file_get_contents('php://input'); 可以取到! 显示 q=test
然而, $_post['q'] 却怎么也取不出来。 $_post 数组为空
整个请求头为:
post /xxx.php?ent_id=xxxx&from=xxxx http/1.1
connection: keep-alive
user-agent: tsl/0.1
content-length: 6
host: 127.0.0.1
(然而, 同样的请求,发到别人服务器上是可以的)
求教各位大神!
对比浏览器发的请求:
多了
Content-Type: application/x-www-form-urlencoded
Referer: http://127.0.0.1/xxxxx
两相, 应该不会和这个有关吧。。。
如果要用$_POST获取到,需要有Content-Type: application/x-www-form-urlencoded
参考: http://blog.csdn.net/fdipzone/article/details/40098169
是的,php的$_POST 需要 有ContentType 才解析。
PHP怎么学习?PHP怎么入门?PHP在哪学?PHP怎么学才快?不用担心,这里为大家提供了PHP速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号