submit button will do 2 things |
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 (10-18-2019, 12:00 AM)im not sure... is it like webhook?ceta Wrote: this project is on 2.1.2 version
Without seeing the code we cannot help you.
Post the method that is getting the form post data. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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', [ |
Welcome Guest, Not a member yet? Register Sign In |