curl-and-php
Re: Can cURL be used to post massaged form data and land the user on anexternal partner page?
Date: Sun, 09 Apr 2006 10:25:50 -0300
You could try using AJAX (do a google search on the term if you are not
familiar with it).
-Lobos
Colin Catlin wrote:
> No worries, after more digging, I guess cURL can’t be used for posting
> data and users to external web pages, just posting and possibly
> snatching web pages.
>
> Any thoughts though are much appreciated on how one might go about
> posting data and users to external web pages securely.
>
> Best,
>
> -Colin
>
> ------------------------------------------------------------------------
>
> *From:* curl-and-php-bounces_at_cool.haxx.se
> [mailto:curl-and-php-bounces_at_cool.haxx.se] *On Behalf Of *Colin Catlin
> *Sent:* Sunday, April 09, 2006 4:55 AM
> *To:* curl-and-php_at_cool.haxx.se
> *Subject:* Can cURL be used to post massaged form data and land the
> user on anexternal partner page?
>
> 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 -
>
>
>
> __________ NOD32 1.1478 (20060409) Information __________
>
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
>
>------------------------------------------------------------------------
>
>_______________________________________________
>http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
>
>
>__________ NOD32 1.1478 (20060409) Information __________
>
>This message was checked by NOD32 antivirus system.
>http://www.eset.com
>
>
>
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2006-04-09