我有两个文件index.php和success.php,如下所示:
index.php包含:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Paypal test</title>
</head>
<body>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="zuhair.53957-facilitator@gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="item">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return" value="http://localhost/paypal/success.php">
<button type="submit">pay now</button>
</form>
</body>
</html>
和success.php包含:
<?php print_r($_POST); ?>
当我点击“立即付款”按钮时,它会转到PayPal,但在成功完成交易后,它会重定向到success.php,而不会显示如下查询字符串:
为什么返回页面上没有查询字符串?
答案 0 :(得分:0)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Paypal test</title>
</head>
<body>
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="business" value="zuhair.53957-
facilitator@gmail.com">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="item_name" value="item">
<input type="hidden" name="amount" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="return"
value="http://localhost/paypal/success.php">
<input type="hidden" name="rm" value="1">
<button type="submit">pay now</button>
</form>
</body>
</html>
我添加了rm的值,您可以参考the values here。
rm代表Return方法。 FORM METHOD用于将数据发送到返回变量指定的URL。
有效值为: