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

[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
#2

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

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

[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
#5

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

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

[eluser]ztinger[/eluser]
Big Grin




Theme © iAndrew 2016 - Forum software by © MyBB