Welcome Guest, Not a member yet? Register   Sign In
Possible to accept $_POST data from non CI form? [solved]

[eluser]Aaron L.[/eluser]

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

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:

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:

Any ideas?


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

Big Grin

Theme © iAndrew 2016 - Forum software by © MyBB