PayPal provide this code, but something is missing.
I understasnd cUrl (I think) but can’t see what I need.
Half way through the code there is something I need to implement. What is this?
// Post back to PayPal to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\\r\
";
$header .= "Content-Type: application/x-www-form-urlencoded\\r\
";
$header .= "Content-Length: " . strlen($req) . "\\r\
\\r\
";
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
// Process validation from PayPal
// TODO: This sample does not test the HTTP response code. All
// HTTP response codes must be handles or you should use an HTTP
// library, such as cUrl
if (!$fp) { // HTTP ERROR
} else {
// NO HTTP ERROR
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {