8.5.0
iduidmodulenametypelabeldata
7233NametextName
8233CompanytextCompany

2 Different ways to post data


- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
script.js

var customerData = {
 'name': "Big Bird",
 'address': '123 Sesame St.',
 'phone': '555-1212'
};


GBS.util.asyncPost( 'api.php?a=addCustomer', customerData );

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
api.php

$customerData = $_POST;

// NOTE: ideally we would sanitize the data first

// BUFFER THE OUTPUT
ob_start();?>


    GBS.util.form('?a=customerDetails&id=');


ob_end_clean();
// END BUFFERING

GBSX::sendScript( $script );

?>