I'm trying to pass an array in an ajax request, but apparently it doesn't work...
$.post("process.php", array,
function(data) {
document.getElementById("output").innerHTML = JSON.parse(data);
});
My question is, how to use the data sent in the process file?
The array is built like that: [key (0/1/2...)] => ["prod_id"]
. The id varies.
I read somewhere using $_POST["key"];
would work, but it doesn't.
It'd be even better if I could just get the array as is in the process file.
process.php
(really basic - just to check wether it's working or not.):
<?php
print($_POST["test"]);
?>