1. #1
    Sencha User davisty's Avatar
    Join Date
    Mar 2010
    Location
    Spanish Fort, Al
    Posts
    277
    Vote Rating
    1
    Answers
    11
    davisty is on a distinguished road

      0  

    Default Unanswered: How to return json from php with ajax call

    Hello,

    Im totally new to PHP. How do I return the json generated from the ajax call.

    Ive seen numerous examples, but they only show tables and such being generated in while loops with echo statements. How do I return the entire json response back to the Ext.ajax in one chunk?

    I used to code on the AS/400 and it had another way of doing it.

    Sorry to ask such a simple question, but Im not familiar enough with PHP yet?

    Thank You

  2. #2
    Sencha User Jad's Avatar
    Join Date
    Feb 2012
    Location
    annecy france
    Posts
    111
    Vote Rating
    3
    Answers
    10
    Jad is on a distinguished road

      0  

    Default

    hello

    Code:
    header('Content-Type: application/json');
    die('{
    	"success": true,
    	"total": ????, 
    	"records": ' . json_encode($records) . ', ' . ' 
    	"msg": "' . $msg . '"
    }');

Thread Participants: 1