cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

Can cURL be used to post massaged form data and land the user on an external partner page?

From: Colin Catlin <colin_at_theideastore.us>
Date: Sun, 9 Apr 2006 04:55:05 -0400

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 -

 

 

 

 

 

 

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-04-09