Possible to accept $_POST data from non CI form? [solved] |
[eluser]Aaron L.[/eluser]
Hello, I am trying to integrate my CI application with my merchant account. In order to complete the transaction and update my customer's account (in CI) I need to post the result data from their API to my CI application. So basically, I am trying to post standard $_POST data from outside of CI to my CI application where it is parsed and updates the user's account. The api posts to a url formatted like this: http://domain.com/index.php/payments/updateaccount is this possible? - Aaron
[eluser]coolfactor[/eluser]
Yes, in the normal way. $_POST is defined in your CI app. Or you can use $this->input->post();
[eluser]Phil Sturgeon[/eluser]
Indeed, CI has no involvement with the way post works. It can come from anywhere and you can still use the $this->input->post(); function.
[eluser]Aaron L.[/eluser]
Hi guys, Thanks for your feedback. I am glad to hear that CI can do this. Here is my next issue then, I'm submitting a plain html form to test posting to my script (which will update the user's account). Here is the url to the test form: http://aaronlovelace.com/test.html When you submit, it appears to send the data to the url it's coming from, not the CI application. I get a 404 not found and the address bar shows: Code: http://aaronlovelace.com/post?amount=120¤cy=usd&orderPage_timestamp=1184286540412&orderPage_version=4&orderPage_serialNumber=1842162628420176043016&merchantDefinedData1=60&merchantDefinedData2=3&billTo_customerID=23&merchantDefinedData4=english¤cy=usd&decision=ACCEPT Any ideas? Aaron
[eluser]coolfactor[/eluser]
You want your form to be posting using method="post". It appears you've using method="get" or not specifying the method in your <form> tag.
[eluser]Aaron L.[/eluser]
Oh DUH!!!! I can't believe I overlooked that. Thanks for finding that for me. It looks like I was using action="post" instead of method="post".
|
Welcome Guest, Not a member yet? Register Sign In |