php - how to retrive extra HTTP variables using datatables -


i using datatables plugin jquery , using fnserverparams function.i have sent variables not sure how retrieve them ont server_processing file.

code :

$('#fleetstable').datatable( { "bprocessing": true, "bserverside": true, "sajaxsource": "/server_processing.php", "fnserverparams": function ( aodata ) { aodata.push( { "name": "customerid", "value": "6" } ); } } ); 

this have tried in server_processing.php file

$customerid = ""; if ( isset( $_get['customerid'] ) ) { $customerid = $_get['customerid'] ; } 

this not seem working..

thaks help

andre's comment wrong. datatables requires send parameters in format of

aodata.push( { "name": "customerid", "value": "6" } ); 

this generate url of:

../server_processing.php?customerid=6 

in server code,

$customerid = $_get['customerid'] ; 

should return value. you'll need more debugging in php file determine variable getting lost. spelling mistake.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

c++ - Accessing inactive union member and undefined behavior? -

php - Get uncommon values from two or more arrays -