Hi,
In essence using php I need to massage the data I get from a
form post on my site, and then afterwards using php, post that data and the
user on to an external partner page. The page is a https page. Like
I said, I want to post the data and the user to the external partner page.
Can I do this with cURL?
What I can do is "post" to an https page using
curl and get a return. But in truth I'm not actually on that external
page, nor is the user.
The external page I'm posting to is an https page, so
I need to land the user on that page as well as post the data to that page.
They need to land on the external page to continue their process and so that
the bottom of the page shows the padlock and secures a follow up post made from
the external page as part of the process.
I can't use a standard location redirect, because it
breaks security to show the name value pairs in the url.
I've tried:
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
But it doesn't seem to actually do anything that I can
see. As it doesn't actually follow the location. Being new it's
possible I don't understand this, I just read this in a few old threads
here.
I've searched on this topic, but nobody seems to
provide any answers and everyone seems to dance around the question, a lot.
Can it be done? Is curl the right tool to use?
Should I be using something else? It seems like the right thing, if it
just posted and pastd the control back to the user rather than returning to the
script.
Thanks for any pointers and help!
Cheers and best regards,
-Colin
- Start of code -
$ch = curl_init ();
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
// perform post
$output=curl_exec($ch);
curl_close($ch);
- End of code -