....
else {
$affiliate->setStatus('D');
echo "Before load";die;
if($affiliate->load())
{
echo $affiliate->getUsername();
die(($affiliate->getUsername())."Success to load affiliate");
}
else
{
$chkaffiliate= new Pap_Api_Affiliate($session);
$chkaffiliate->setUsername($_POST['txt_email']);
if($chkaffiliate->load())
{
echo $chkaffiliate->getUsername();
}
die("Failed to load affiliate");
}
die("Failed to process payment,account request declined. <br><br>Please try again using a different email OR Contact our support team to manually approve your account.".$response->error_message);
}
我得到了输出Failed to process payment...
,即上面代码中的最后一个die()
,但是我没有得到第一个回显中的Before Load
,而两者都在同一个块中。什么好主意吗?
这是不可能的。
if (something){
die();
}
else{
die();
}
无论如何,每次都死亡。查找其他die("Failed to process payment");
函数调用
你的问题是这一行:
echo "Before load";die;
在echo语句后立即死亡,因此不会发生其他处理!