IPN用于将订单详细信息放入,等等。但是我试图将item_numbers返回到MySQL表格中......我无法看到我出错的地方。而且我无法解决如何记录我的_POST。我猜测它只是没有找到任何item_numbers ......但我无法获得_POST变量来查看究竟是什么进来。
$oID = $_POST['txn_id']; // joins o and oItems
$n = 1;
while (TRUE)
{
if (isset(${"_POST['item_number" . $n . "']"}))
{$item_numbers[] = ${"_POST['item_number" . $n . "']"};}
else {break;}
$n++;
}
$n = 1;
foreach ($item_numbers as $key => $item_number)
{
$pID = $item_number;
$pAmount_o = ${"_POST['mc_gross_" . $n . "']"};
$pQuantity = ${"_POST['quantity" . $n+1 . "']"};
$q = "INSERT INTO `oItems` (ID, pID, pAmount_o, oID, pQuantity) VALUES ('', '$pID', '$pAmount_o', '$oID', '$pQuantity')";
mysqli_query($c, $q);
$n++;
}
我不能告诉你这个日志发生了什么...... :(
$t = time();
$post = serialize(print_r($_POST));
$q = "INSERT INTO `ipnLogs` (`logID`, `logTime`, `logType`, `logContent`) VALUES ('', '$t', '_POST', '$post')";
mysqli_query($c, $q);