PayPal Donate Button Redirect After Payment

与世无争的帅哥 提交于 2019-12-06 13:31:27

yes it is possible, like so:

<!-- where you setup your paypal button : -->
<input type="hidden" name="return" value="http://example.com/donate?amount=<?php echo $amount ?>" />

But (concerning security)

It would be better to keep it in e.g. $_SESSION['amount'] along with a reference id $_SESSION['reference_id'] = md5('whatever you like' . 'plus salt');

And in the paypal button use that reference_id like so:

<input type="hidden" name="return" value="http://example.com/donate?ref=<?php echo $_SESSION['reference_id'] ?>" />

And then, if $_GET['ref'] == $_SESSION['reference_id'], then you can use the $_SESSION['amount'] variable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!