I am using datatables plugin for jquery and I am using the fnServerParams function.I have sent some extra variables but I am not sure how to retrieve them ont he server_processing file.
code :
$('#fleetsTable').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/server_processing.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "customerId", "value": "6" } );
}
} );
this is what I have tried in the server_processing.php file
$customerId = "";
if ( isset( $_GET['customerId'] ) )
{
$customerId = $_GET['customerId'] ;
}
this does not seem to be working..
thaks for the help
Andre's comment is wrong. Datatables requires you to send parameters in the format of
aoData.push( { "name": "customerId", "value": "6" } );
This would generate a URL of:
../server_processing.php?customerId=6
in your server code,
$customerId = $_GET['customerId'] ;
should return the value. You'll need more debugging in your php file to determine where the variable is getting lost. Most likely a spelling mistake.