Php 无法在返回url中获取paypal post pramenters

Php 无法在返回url中获取paypal post pramenters,php,html,paypal,paypal-ipn,Php,Html,Paypal,Paypal Ipn,我有一个代码用于将一些自定义变量传递给PayPal,这些变量是在返回页面中收集的,但是当尝试获取这些值时,它不起作用 我有这样一个贝宝表单: <form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post"> <input type="image" src="submit.png" name="submit" alt="Make payments with PayPal - it

我有一个代码用于将一些自定义变量传递给PayPal,这些变量是在返回页面中收集的,但是当尝试获取这些值时,它不起作用

我有这样一个贝宝表单:

<form target="paypal" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="image" src="submit.png" name="submit" alt="Make payments with PayPal - it's fast, free and secure!"/>
<input type="hidden" name="add" value="1"/>
<input type="hidden" name="custom" value="IP"/>
<input type="hidden" name="cmd" value="_cart"/>
<input type="hidden" name="business" value=""/>
<input type="hidden" name="item_name" value=""/>
<input type="hidden" name="item_number" value=""/>
<input type="hidden" name="amount" value=""/>
<input type="hidden" name="page_style" value=""/>
<input type="hidden" name="no_shipping" value="1"/>
<input type="hidden" name="return" value="index.php?action=success"/>
<input type="hidden" name="notify_url" value="index.php?action=ipn"/>
<input type="hidden" name="cancel_return" value=""/>
<input type="hidden" name="rm" value="2"/>
<input type="hidden" name="cn" value="Additional Information"/>
<input type="hidden" name="currency_code" value="AUD"/>
<input type="hidden" name="bn" value="PP-ShopCartBF"/>
</form>


我在付款后成功返回URL。现在我只想打印POST变量,它没有给我任何值。我尝试过启用和禁用“自动返回”。在这两种情况下,我都没有得到值。请帮助我,提前谢谢。

paypal将异步(直接)联系“通知url”,您与此交易无关。因此,您永远不会在浏览器中看到任何结果。您应该在脚本中使用某种日志记录来查看实际发送的内容。检查您的web服务器的访问日志,查看paypal是否确实在联系您的脚本(并确保您尝试的不是“本地主机”)

如果我没有记错,则只会将事务id发送回返回url。notify_url也接收该id。从那里你应该能够沟通这两个网页,以满足您的需要

您是在尝试使用正确的URL还是您的“localhost”服务器?我使用的是从http://If “这些是在返回页面中收集的”你说的“不工作”是什么意思?我可以在notify_url中获取值,但我需要在返回url中获取相同的值。你不能,返回url是静态定义的。如果您需要将表单变量同时发送到paypal和您的本地脚本,那么在发送到paypal之前,请考虑使用javascript收集表单变量并单独发送。返回URL被指定为HTML变量,而不是静态的,rm=2应该将所有传入的post变量发送回它。请参阅IPN手册。我无法获取任何值,当我在页面中使用print_r($_POST)时,它会返回我的数组()对不起,如果启用PDT,我们将在返回url中获取事务id,在此之后,我们可以使用PDT检索详细信息,我已经按照说明进行了操作,它对我来说很好。谢谢大家。rm=2被指定为将所有传入的POST变量发回返回URL。请参阅IPN手册。