submit button will do 2 things - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: submit button will do 2 things (/showthread.php?tid=74634) |
submit button will do 2 things - ceta - 10-18-2019 this project is on 2.1.2 version the existing apps will post/submit form and save the input to database... now i want to make the button will do post the same data to another webservice at another host... what should i do? how to know what's the detail data posted ... i've found the code related to the page on folder [CI_ROOTDIR]/application/controller/production.php... CMIIW Note: i have set the print($data) but nothing printed on the page... any pointer will be appreciated RE: submit button will do 2 things - ceta - 10-18-2019 (10-18-2019, 12:00 AM)im not sure... is it like webhook?ceta Wrote: this project is on 2.1.2 version RE: submit button will do 2 things - InsiteFX - 10-18-2019 Without seeing the code we cannot help you. Post the method that is getting the form post data. RE: submit button will do 2 things - fernaog - 10-18-2019 (10-18-2019, 12:00 AM)ceta Wrote: this project is on 2.1.2 version A simple way to do it is by sending the form through ajax, so you can send both requests without problem. The following jQuery plugin makes it very easy to send with ajax: https://jquery-form.github.io/form/ You could for example insert the first group of data using the submit form and if the registration is done correctly then make the second request to insert the data using the callback: Code: <script> A second variant could be to send the form without ajax, that is to say "in a normal way" and then in the action of the controller that handles the request make the second request using some tool like Guzzle for example: https://github.com/guzzle/guzzle PHP Code: $response = $client->request('POST', 'http://httpbin.org/post', [ |