对方说自己用的是asihttp,post过来的。
那么我能直接接收到吗?还有如何检测我有没有收到别人post过来的数据或别人有没有发送数据过来?
<?php
$json=$_POST;
$json=json_decode[$json,true];
$conn=@mysql_connect("localhost:3306","root","")or die ("数据库链接失败");
mysql_select_db("test",$conn);
$sql = mysql_query("insert into table value ($json[0]);");
mysql_close;
?>
不是,post过来的也需要是key value的键值对才能$_POST读取。
$raw = file_get_contents("php://input","r");
可以接受任何形式的post数据