I have this Problem and because I am very fresh in this subject I don't know how to procedure. I want to read the Content of a Array variable sended from Jquery by Post to the Server Php. Then I could separate the values and send differents query to the DB
This is what I have:
var Content = {};
var subcontent= {};
var key;
$("table tr.data").each(function(i) {
var row = [];
key = $(this).find('td').eq(0).find('input').val();
row.push($(this).find('td').eq(1).text());
row.push($(this).find('td').eq(2).text());
row.push($(this).find('td').eq(5).text());
subcontent[key] = row;
});
Content['.select'.val()] = subcontent;
var ContentJSON= JSON.stringify(Content);
$.ajax({
data: ContentJSON,
url: 'page.php',
type: 'POST',
dataType: 'json',
beforeSend: function (){
alert('Information wird gespeichert');
},
success: function (r) {
$("#resultado").html(r);
alert('Information wurde gespeichert');
},
error: function(){
alert('Fehler ..');
}
});
How is the procedure in Server side with PHP to read the Content of this variable. Can please somebody help me?