url parameters not working @ server side processing

url parameters not working @ server side processing

tester1tester1 Posts: 53Questions: 14Answers: 1
edited August 2014 in Free community support

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

Answers

  • tester1tester1 Posts: 53Questions: 14Answers: 1

    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

  • tester1tester1 Posts: 53Questions: 14Answers: 1

    ANY ONE HERE ?

    Please help me :(

  • tester1tester1 Posts: 53Questions: 14Answers: 1

    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

  • mRendermRender Posts: 151Questions: 26Answers: 13

    try something like

    "sAjaxSource": "mypage.php?name=Joe?title=Hello",

    and use $_GET to see if you can send it through that way.

  • allanallan Posts: 63,601Questions: 1Answers: 10,486 Site admin

    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.

  • tester1tester1 Posts: 53Questions: 14Answers: 1

    @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

  • allanallan Posts: 63,601Questions: 1Answers: 10,486 Site admin

    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

  • tester1tester1 Posts: 53Questions: 14Answers: 1
    edited August 2014

    Hey allan ,

    Thanks for the response .

    Can you please share /ssp/server_processing.php direct link .. with ECHO $_GET['title'] in it

    if possible

  • tester1tester1 Posts: 53Questions: 14Answers: 1

    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; "

  • allanallan Posts: 63,601Questions: 1Answers: 10,486 Site admin

    Can you please share /ssp/server_processing.php direct link .. with ECHO $_GET['title'] in it

    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.

    can u guide me ? is this " $.fn.dataTable.ext.legacy.ajax = true; "

    Sorry, I should have removed that. It works without it: http://live.datatables.net/sovodoca/2

    Allan

  • tester1tester1 Posts: 53Questions: 14Answers: 1

    Ok thanks

This discussion has been closed.