I try to pass ids as array via ajax but when I dump out the get variable on server side with PHP I do not get any values, the array is empty. Debugging with firebug I see that the array is getting passed but []
is encoded ids%5B%5D
my javascript
function update_category(selected) {
$.ajax({
url: '/admin/?controller=products&action=update_category',
type: 'GET',
dataType: "application/JSON",
data: {
ids: cat_ids,
s_category: selected
},
success: function(data) {
addAlert('alert-'+data, data);
},
error: function(data) {
addAlert('alert-'+data.responseText, data.responseText);
}
});
}
var_dump $_GET['ids']
null dumping the hole $_GET
I get ["ids%5B%5D"]
I do not understand why the array is getting encoded on submit in linux environment
Under ubuntu 12.10 PHP 5.3.10 Firebug XHR->PARAMS
action update_category
controller products
ids%5B%5D 1403172219
ids%5B%5D 1530542001
s_category 1
how to pass properly the array?