External Form Data to a external action page
Permalink
Hey guys,
I been trying to look around where I can send data from an external form to a action page on another website. This will be a mail subscription where I need to send the user and email details and then redirect to a thank you page.
Any ideas how I can do this?
cheers,
Ritch
I been trying to look around where I can send data from an external form to a action page on another website. This will be a mail subscription where I need to send the user and email details and then redirect to a thank you page.
Any ideas how I can do this?
cheers,
Ritch
Thanks for replying. I don't have any control over the action page that is hosted elsewhere, so it will most likely go to its own thank you page. I was more questioning whether i can pass this data over to a controller, and somehow send this data to that external action page in which I can then forward to my own thank you page.
Using PHP and CURL you can post data to an external script, let it do it's own thing, and then carry on with your own script on your server where it can send an email and whatever.
In C5, this code would be handled in a controller.
Expanding on this, all of the POST data from a form of your C5 site is available for processing in the page's controller script. And then it can return info. back to the main page about success/failure etc. for display to the user.
If you re-direct your page to the external page then you lose this control. You need to use CURL or AJAX, preferably CURL.
In C5, this code would be handled in a controller.
Expanding on this, all of the POST data from a form of your C5 site is available for processing in the page's controller script. And then it can return info. back to the main page about success/failure etc. for display to the user.
If you re-direct your page to the external page then you lose this control. You need to use CURL or AJAX, preferably CURL.
Plus one on the CURL, though if you are using an external form you don't do it within the form's controller, you do it in the controller for the external form.
You could also do your processing on the form inputs, then do a submit to the external page if that's what you need to do. The external form will by default have an action back to that block's controller, then pass-through to the form controller. You should have access to $_POST there.
You could also do your processing on the form inputs, then do a submit to the external page if that's what you need to do. The external form will by default have an action back to that block's controller, then pass-through to the form controller. You should have access to $_POST there.
I am new to C5 but good at PHP, yet I am wanting to do it the C5 way without taking training courses ;)
Thanks for the advice guys! Find it hard to believe no one has asked this question, or maybe this is considered an easy thing to do...
I too find it hard that this has not been clearly addressed, I'm still not getting how I can use my own external post url on C5 forms.
Then tell myExternalURL to redirect to a thankyou page that's hidden from your root navigation.