PHP: how to obtain the array uploaded by jsonp. This post was last edited by zl2727 from 2014-01-0914: 19: 55 & nbsp; var & nbsp; urlstr & nbsp; {GID: & nbsp; + & nbsp; $ (# hogid ). val () & nbsp; + & nbsp;, Name: & nbsp; + & nbs PHP: how to obtain arrays transmitted by jsonp
This post was last edited by zl2727 at 14:19:55 on
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 + "'}";
$. Ajax ({
Url: "http://www.xxx.com/car.php ",
Type: "POST ",
Data: urlstr,
Async: false,
DataType: 'jsonp ',
Jsonp: "callback ",
JsonpCallback: "getgoods ",
Success: function (data ){
Alert (data. res );
},
Error: function (err ){
Alert ("Network loading is busy. please refresh! ");
}
});
How to obtain data
In my php file
$urlstr = $_POST;
echo $urlstr.Name;
How should I write nothing?
Share: More
------ Solution --------------------
File_put_contents('test.txt ', print_r ($ _ GET, 1 ));
View the content of the test.txt file