從數據庫中檢索電子郵件,從paypal獲取代碼,並將$ email變量放入輸入值。
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value='".$email."'> // here the email from DB
<input type="hidden" name="lc" value="US">
<input type="hidden" name="button_subtype" value="services">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHosted">
<input type="image" src="https://www.paypalobjects.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypalobjects.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
如果你不想按鈕只是鏈接到https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=test%40hotmail%2ecom&lc=US&button_subtype=services¤cy_code=USD&bn=PP%2dBuyNowBF%3abtn_buynowCC_LG%2egif%3aNonHosted
其中business=test%40hotmail%2ecom
是變量格式化
你looket在一些教程?我發現,例如http://jdmweb.com/how-to-easily-integrate-a-paypal-checkout-with-php – 2013-04-03 18:47:05
是的,我試圖找到。你提供的鏈接是關於一個完整的網上商店,但我只想要一個定製的按鈕,因爲我只有一個服務(訪問某個成員區域)出售。所以我認爲可以自定義的「現在付款」按鈕是最好的。另外,「按鈕」並不在我的頁面上,而是發送給用戶並作爲鏈接嵌入到電子郵件中。 – user1513073 2013-04-03 18:50:44