CodeIgniter Forums
Possible to accept $_POST data from non CI form? [solved] - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: Possible to accept $_POST data from non CI form? [solved] (/showthread.php?tid=2039)



Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-12-2007

[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


Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-12-2007

[eluser]coolfactor[/eluser]
Yes, in the normal way. $_POST is defined in your CI app. Or you can use $this->input->post();


Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-12-2007

[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.


Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-12-2007

[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&currency=usd&orderPage_timestamp=1184286540412&orderPage_version=4&orderPage_serialNumber=1842162628420176043016&merchantDefinedData1=60&merchantDefinedData2=3&billTo_customerID=23&merchantDefinedData4=english&currency=usd&decision=ACCEPT

Any ideas?

Aaron


Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-13-2007

[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.


Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-13-2007

[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".


Possible to accept $_POST data from non CI form? [solved] - El Forum - 07-13-2007

[eluser]ztinger[/eluser]
Big Grin