im trying to pass an array of data to a PHP script using Jquery's AJAX; this is my JS:
var dataObject = {
shippingDataRow: [{
name: $('#shippingData_name').val(),
street: $('#shippingData_street').val(),
number: $('#shippingData_number').val(),
}]
};
$.ajax({
type: "post",
data: { action: 'test', data: dataObject },
cache: false,
url: "php/post_test.php",
});
And this is the PHP (just doing some tests, before I can write all procedures),
<?php
function test(){
$dataObject = $_POST['dataObject'];
print_r( $dataObject );
}
?>
In Chrome's Developer Tools, I can see the Status Code:200 OK; even all the array with the correct values, but when I open the php it doesn't work.
Any ideas?
var_dump($_POST);?