need a little help with this one.
I have a form that I am validating using the “form_validation” library in codeigniter, obviously the form action is pointing to itself for validation (as it should) but i need to submit to an external url, with the post data included, if validation successful.
CURL is not an option as i need the user to also be redirected to that page and GET method is also not an option as the data needs to be POSTed!!
it almost needs a function like PHP redirect() that you can attach an array of post data to.
ideal world = redirect('https://payment.bank.com', 'method: POST', $data_array);
if there is no way to do this i may have to invent it, but want to ask the question first before i go re-iventing the wheel (it will also take a considerable amount of time, i guess)
EDIT: also note javascript is also not an option as the site needs to work with or without javascript enabled!!!!!
This is not possible the way you describe it, as PHP is server side, and it would be the SERVER submitting the data, NOT the user, so the redirect to that data would NOT be possible.
You could CURL the data, then redirect based on a ‘reference’ from the foreign server (say submission ID).
However the most simple approach would be to do this:
Keep in mind if you are doing a post like this without permission, the foreign post might have cross domain submission checking (say abc.com not allowed to submit to xyz.com).
Hope that helps.