Skip to content

Instantly share code, notes, and snippets.

@safounette
safounette / gist:6144515
Created August 3, 2013 00:35
problème avec les headers, il faut ajouter $header .= "Host: www.sandbox.paypal.com\r\n";
$header = "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Host: www.sandbox.paypal.com\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);