【发布时间】:2016-11-17 22:17:23
【问题描述】:
我正在尝试使用 webhook 模拟器来确保信息在继续之前至少会发送到我们的服务器。好消息是,在我的日志中我看到请求做了something,但问题是所有变量都是空白的。我正在使用 php,根据我的打印输出,$_GET、$_POST 和 $_REQUEST 都是空数组。有人对如何解决此特定问题有任何提示吗?
以下是我们服务器上唯一的代码(再次,只是想看看数据是否成功)。
<?php
function write_to_log($text) {
try {
$file = fopen("../../../paypal_test_log.txt", "a");
$text = date("m/d/Y H:i:s") . " -- " . $text . "\n";
fwrite($file, $text);
fclose($file);
} catch(Exception $e) {
echo 'error<br/>';
echo $e->getMessage();
}
}
header('HTTP/1.1 200 OK');
write_to_log('===============================================testing post');
write_to_log(print_r($_POST, true));
write_to_log('===============================================get');
write_to_log(print_r($_GET, true));
write_to_log('===============================================request');
write_to_log(print_r($_REQUEST, true));
?>
事件发生后的服务器日志:
07/14/2016 15:07:22 --
===============================================testing post 07/14/2016 15:07:22 -- Array ( )
07/14/2016 15:07:22 --
===============================================get 07/14/2016 15:07:22 -- Array ( )
07/14/2016 15:07:22 --
===============================================request 07/14/2016 15:07:22 -- Array ( )
【问题讨论】:
-
您能发布相关的代码供我们查看吗?这将有助于缩小问题所在。
-
帖子更新了。
标签: php paypal paypal-webhooks