Get HTTP Variables in server
Get HTTP Variables in server
Hello, I have a page that define a table and I call the datatable initilization on this way:
[code]
$(document).ready(
function() {
$('#table1').dataTable( {
"bProcessing": true,
"bServerSide": true,
'sAjaxSource':'get_data.php',
} );
} );
[/code]
I want to send some parameters to set my sql call and I don't know how can I make this. I have readed about overloading the .getJSON function and I tried this:
[code]
aoData.push( { "key1": "data1", "key2": "data2" } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
[/code]
I don't know how I can get any parameters in the server page to use them.
Thank you
[code]
$(document).ready(
function() {
$('#table1').dataTable( {
"bProcessing": true,
"bServerSide": true,
'sAjaxSource':'get_data.php',
} );
} );
[/code]
I want to send some parameters to set my sql call and I don't know how can I make this. I have readed about overloading the .getJSON function and I tried this:
[code]
aoData.push( { "key1": "data1", "key2": "data2" } );
$.getJSON( sSource, aoData, function (json) {
fnCallback(json)
} );
[/code]
I don't know how I can get any parameters in the server page to use them.
Thank you
This discussion has been closed.
Replies
Allan
[code]aoData.push( { "name": "more_data", "value": "my_value" } );[/code]
Like in the example you just need:
[code]
$_GET['more_data']
[/code]
Note that there is a slight difference to how you have you key/value pair to the name/value pair in the example.
Allan