johnsmith153 Posted November 13, 2010 Share Posted November 13, 2010 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\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $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) { Quote Link to comment https://forums.phpfreaks.com/topic/218535-fp-fsockopen-sslwwwpaypalcom-443-errno-errstr-30/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.