Paypal 隐藏变量不起作用
可能的重复:
提交 Paypal 表单时的变量
//Buy.php
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="hosted_button_id" value="EWE57TOG6A1GO">
<input type="hidden" name="user_id" value="12345">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>
成功付款后。 您将被重定向到
www.thankyou.com/thankyou.phptx=2TB90771KK039521H&st=Completed&amt=1.00&cc=PHP&cm=&item_number=11
//Thankyou.php
<?php
extract($_REQUEST);
echo $user_id;
?>
我正在尝试打印user_id 但它是空的。
所以我的问题是:
1)如何将变量从我的网站发送到贝宝? (谈论user_id)
2)重定向到thankyou.php时如何获取该user_id的值?
提前致谢!
Possible Duplicate:
Variables upon submitting Paypal form
//Buy.php
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="hosted_button_id" value="EWE57TOG6A1GO">
<input type="hidden" name="user_id" value="12345">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_paynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
</form>
After the successful payment.
You'll be redirected to
www.thankyou.com/thankyou.phptx=2TB90771KK039521H&st=Completed&amt=1.00&cc=PHP&cm=&item_number=11
//Thankyou.php
<?php
extract($_REQUEST);
echo $user_id;
?>
I am trying to print the user_id but it is empty.
So my Question is:
1) How can I send variable from my site to paypal? (talking about the user_id)
2) How to get the value of that user_id when redirected to thankyou.php?
Thanks in ADVANCE!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
试试这个。当我实施 PayPal 时,它对我有用。
稍微编辑:数组参数应该用引号引起来,echo 语句中不需要双引号。
Try this. It worked for me when I implemented PayPal.
Slight edit: The array parameter should be in quotes and the double quotes are unnecessary in the echo statement.