I have the following json object:
$scope.sellAccessories=
[
{"id": "1","name": "aa", "quantity": "3","total_price": "100"}
,
{"id": "2","name": "bb", "quantity": "4","total_price": "200"}
,
{"id": "3","name": "cc", "quantity": "5","total_price": "300"}
];
i sent the object using ajax as follow:
var options={
type : "get",
url : "../php/sell.php",
data: {"function":"sellAccess","data":$scope.sellAccessories},
dataType: 'json',
async : false,
cache : false,
success : function(response,status){
alert("success")
},
error:function(request,response,error){
alert("error")
}
};
$.ajax(options);
I tried to receive the data using $_GET['name'] but it didn't work
My php code:
$item_name=json_decode($_GET['name']);
i also, tried to do: $data=json_decode($_GET['data']);
but none of them works!
thanks in advance