[nycphp-talk] Posting data to PayPal from a script using sockets
Adam Maccabee Trachtenberg
adam at trachtenberg.com
Thu Jun 10 14:43:47 EDT 2004
On Thu, 10 Jun 2004, Jose Villegas wrote:
> Curl is very straightforward. Just try something like this out:
>
> ob_start();
> $ch = curl_init('http://www.target-site.com/');
> curl_setopt($ch, CURLOPT_POST, 1);
> curl_setopt($ch, CURLOPT_POSTFIELDS, 'name=example');
> curl_exec($ch);
> curl_close($ch);
> $response = ob_get_contents();
> ob_end_clean();
You can omit the output buffering calls if you set
CURLOPT_RETURNTRANSFER to true (or 1).
-adam
--
adam at trachtenberg.com
author of o'reilly's php cookbook
avoid the holiday rush, buy your copy today!
More information about the talk
mailing list