PHP的贝宝不返回任何东西 [英] php paypal is not return anything
本文介绍了PHP的贝宝不返回任何东西的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在用贝宝(Paypal)测试我的网站,以查看我是否收到钱并且系统正在更新
I'm test my site with paypal to see if i am receiving money and my system is being updated
当我要求发送包含POST中所有信息的电子邮件时,我得到的电子邮件为空.有人可以告诉我我的代码出了什么问题吗
When I ask to send email with all the information in POST I get empty email. Can someone tell me what is wrong with my code
$req = 'cmd=_notify-validate';
$req .= payment_safe_check ($_POST);
$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";
$mode = strtolower($paymod_data['PAYMENT_MODE']);
mail("to email", "subject",serialize($_POST) );
if ($mode == 'test')
{
$fp = fsockopen ('ssl://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
}
else
{
$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);
}
if (!$fp)
{
// HTTP ERROR
die ("Error");
}
else
{
// NO HTTP ERROR
fputs ( $fp, $header . $req );
while (!feof($fp))
{
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0)
{
processing ( $_POST );
}
else if (strcmp ($res, "INVALID") == 0)
{
}
}
fclose ($fp);
}
推荐答案
在while代码中放入var_dump($ res),因为这是变量所在的上下文.
Put var_dump($res) in the while code since that is context in which the variable exists.
这篇关于PHP的贝宝不返回任何东西的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文