Need a little PHP help - New Paypal validation.
#1
I just received an e-mail from Paypal that I'm going to need to update my Validation form with them.

paypal Wrote:Action Required before February 1, 2013
Merchants need to update their IPN and/or PDT scripts to use HTTP 1.1, and include the “Host” header in the IPN postback script.

Example:

PHP
// post back to PayPal system to validate
$header .="POST /cgi-bin/webscr HTTP/1.1\r\n";
$header .="Content-Type: application/x-www-form-urlencoded\r\n";
$header .="Host: 'www.paypal.com\r\n';;

Now, my question is, my current php script is:


// post back to PayPal system 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";

I'm wondering: Do I need to keep content length in the header? Or.... Should I just ditch it, and go with the example?
nobody ever slaughtered an entire school with a smart phone and a twitter account – they have, however, toppled governments. - Jim Wright
Reply


Messages In This Thread
Need a little PHP help - New Paypal validation. - by shoju - 09-13-2012, 01:48 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)