External Form Data to a external action page
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?
<form id="my-form" name="my-form" method="post" action="http://myExternalURL.php">
Then tell myExternalURL to redirect to a thankyou page that's hidden from your root navigation.
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.
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.