url parameters not working @ server side processing
url parameters not working @ server side processing
tester1
Posts: 53Questions: 14Answers: 1
Hey Allan,
Could you please help me in this .. as it bit urgent..
I need something like this :
mypage.php?title=Hello&name=Joe
$(document).ready(function() {
$('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "mypage.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "title", "value": "Hello" } );
aoData.push( { "name": "name", "value": "Joe" } );
}
} );
} );
But when i am checking @ my mypage.php
echo $_GET['title']; OR echo $_GET['name'];
// even tried below
echo $_GET['name']; OR echo $_GET['value'];
But i am not getting its value.
USING 1.10.2
Where i am wrong
This discussion has been closed.
Answers
its not only allan can give answer , if any one knowing above answer please let me know.
i am 100% sure many will have above answer but ...what to say ...:(
help me guys
ANY ONE HERE ?
Please help me :(
It will help me to make less sAjaxSource file
else i have to make many sAjaxSource file for each action ...
if above works then only one sAjaxSource will do all my work with if else condition with above paramaters
hence pls help me
try something like
"sAjaxSource": "mypage.php?name=Joe?title=Hello",
and use $_GET to see if you can send it through that way.
The code given should work, so there eight be something wrong with the old style 1.9- syntax compatibility there. However, I would suggest you use
ajax.data
rather than the old style parameters.Allan
p.s. For urgent support - priority support is available.
@Modgility : yes i tried that to but no result.
@ allan : i am using 1.10.2 version .. all are latest version ...
but still not able to see $_GET AND $ REQUEST VALUES
Seems to work for me: http://live.datatables.net/sovodoca/1 . Can you please link to a test case showing the problem (as noted in the forum rules).
Allan
Hey allan ,
Thanks for the response .
Can you please share /ssp/server_processing.php direct link .. with ECHO $_GET['title'] in it
if possible
As your ajax and my ajax code are almost same
$(document).ready(function() {
$('#example').dataTable( {
"bServerSide": true,
"sAjaxSource": "mypage.php",
"fnServerParams": function ( aoData ) {
aoData.push( { "name": "title", "value": "Hello" } );
aoData.push( { "name": "name", "value": "Joe" } );
}
} );
} );
except this line : $.fn.dataTable.ext.legacy.ajax = true;
can u guide me ? is this " $.fn.dataTable.ext.legacy.ajax = true; "
The script isn't doing anything with that data. However, you can see your extra parameters in the 'GET' URL that is sent by the browser in your browser's developer tools.
Sorry, I should have removed that. It works without it: http://live.datatables.net/sovodoca/2
Allan
Ok thanks