--- Incase the page dissappears in the future, here is the page contents: --- NB - This is yet to be tested as a resolutions to the problem. IPN: HTTP1.0 to HTTP1.1 - php coding tips Published 01/25/2013 10:23 AM | Updated 11/01/2013 03:34 AM Developers need to include the "Host" and "Connection" headers in the IPN postback script: PHP // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.1\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Host: www.paypal.com\r\n"; $header .= "Connection: close\r\n\r\n"; PLEASE NOTE: 1) For further compatibility your php script should also trim the IPN validation response. Please modify your script: From: if (strcmp ($res, "VERIFIED") == 0) { .. else if (strcmp ($res, "INVALID") == 0) { To: if (strcmp (trim($res), "VERIFIED") == 0) { .. else if (strcmp (trim($res), "INVALID") == 0) { 2) In php make sure the last line of your header includes double end-of-line markers: \r\n\r\n as in the example above: $header .="Connection: close\r\n\r\n"; 3) In php make sure to open the socket connection to the same host declared in the header. As your header is declaring the host as $header .="Host: www.paypal.com\r\n"; You should open the connection to the same host: $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
... View more