how to get $_POST data
how to get $_POST data
moec
Posts: 6Questions: 5Answers: 0
I'm building my table dynamically with datatables, so I don't have any input or names associated with my table.
paging: false,
"ajax": "includes/payroll.php",
"columns": [
{
"className": 'details-control',
"orderable": false,
"data": null,
"defaultContent": ''
},
{"data": "empNum"},
{"data": "empName"},
{"data": "unitRate"},
{"data": "rate"},
{
"data": "gross"
},
],
"order": [[1, 'asc']]
});
I'm using this to try and get the post variables like this
$('button').click(function () {
var data = table.$('input').serialize();
alert(
"The following data would have been submitted to the server: \n\n" +
data.substr(0, 120) + '...'
);
return false;
});
I understand that the above code is trying to serialize all 'input' from my table but seeing how I technically don't have any inputs how do I get post data to process to server with php?
This discussion has been closed.
Answers
The table itself will make the request to the server when an action is taken such as sorting, paging, searching etc. It looks like you are missing a key parameter
serverSide: true
. Have a look at the docs for a good run down on server side tables.