NYCPHP Meetup

NYPHP.org

[nycphp-talk] Posting data to PayPal from a script using sockets

Jose Villegas jv_nyphp at duikerbok.com
Thu Jun 10 15:15:49 EDT 2004


On Jun 10, 2004, at 2:43 PM, Adam Maccabee Trachtenberg wrote:
> 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).

Thanks for the pointer
Jose




More information about the talk mailing list