Home >Backend Development >PHP Tutorial > PHP 怎么获取jsonp传的数组

PHP 怎么获取jsonp传的数组

WBOY
WBOYOriginal
2016-06-13 12:30:10947browse

PHP 如何获取jsonp传的数组

本帖最后由 zl2727 于 2014-01-09 14:19:55 编辑
  var urlstr = "{GID:'" + $("#hogid").val() + "',Name:'" + $("#txtName").val() + "',ProvinceID:'" + $("#ProvinceID").val() + "',CityID:'" + $("#CityID").val() + "',AreaID:'" + $("#AreaID").val() + "',Moblie:'" + $("#txtMobile").val() + "',Address:'" + $("#txtAddress").val() + "',PayType:'" + itemvalue + "'}";<br />
    $.ajax({<br />
        url: "http://www.xxx.com/car.php",<br />
        type: "POST",<br />
        data: urlstr,<br />
		async:false,<br />
		dataType:'jsonp',<br />
		jsonp: "callback",<br />
		jsonpCallback:"getgoods", <br />
        success: function (data) {<br />
          alert(data.res);<br />
        },<br />
        error: function (err) {<br />
            alert("网络加载繁忙,请刷新!");<br />
        }<br />
    });


如何获取到 data 
我的PHP文件中
$urlstr = $_POST;<br />
echo $urlstr.Name;<br />

什么都没有  应该如何编写?
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn