Hi all,
Im a bit thrown by curl. I want to submit some order data on an ecommerce
site via a form to a php page, where the data is saved to a database.
Then I want to use curl to submit the form data I just saved (and
redirect the user) to my secure credit card gateway.
Problem is, they have their own secure payment screen where the credit
card information is entered. I can't just retrieve the variable with a
transaction success/failure setting. Plus, the curl code I use sends me
there as if I was still on my own server. No secure connection, and the
graphics on their server tries to load from mine. Looks very poor.
Anyway, here's the code:
$ch = curl_init("http s://server.com/payment.url");
curl_setopt($ch , CURLOPT_HEADER, 0);
curl_setopt($ch , CURLOPT_POST, 1);
curl_setopt($ch , CURLOPT_POSTFIE LDS, $postdata);
curl_setopt($ch , CURLOPT_FOLLOWL OCATION, 1);
curl_setopt($ch , CURLOPT_REFERER , "http://site.com/payment.html");
curl_setopt($ch , CURLOPT_RETURNT RANSFER, 0);
curl_exec($ch);
curl_close($ch) ;
I guess my question is - is there an option in curl to acutally get the
browser to follow the posted data as if I clicked the button on a page?
FOLLOWLOCATION does not get me there for some reason.
All help is greatly appreciated!
DB
Comment