我有一個表單,它在提交時收集數據並在我的數據庫中寫入字段的值。該表單使用一個發佈請求到響應頁面,然後連接到數據庫並將所有必要的字段發佈到我的數據庫。表單發佈到數據庫以及PayPal
我也有一個單選按鈕稱爲付款,其中一個選項是貝寶。我的目標是最終發佈領域的分貝,而且下面的表格資料寄給我的PayPal帳戶中的一個去
<form name="_xclick" action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick" />
<input type="hidden" name="business" value="myemails" />
<input type="hidden" name="currency_code" value="GBP" />
<input type="hidden" name="item_name" value="Digital Download" />
<input type="hidden" name="amount" value="9.99" />
<input type="hidden" name="return" value="http://myurl/form.htm" />
<input type="hidden" name="notify_url" value="http://myurl/example/ipn.php" />
<input type="image" src="btn_buynow_LG.gif" border="0" name="submit" alt="Paypal" />
</form>
我知道我可以使用下面的下面的命令做一個重定向到另一個網頁,其中有一個形式
if($_REQUEST['payment']=="Paypal") { redirect to another page with the code above, but the user has to click on submit again}
但是我只是想在用戶點擊提交一次,我的數據庫記錄的詳細信息,然後自動將其重定向到PayPal。
您的臨時數據,爲什麼忘記$ _REQUEST? – fdreger
@fdreger這是一個潛在的漏洞,並允許攻擊者執行攻擊更容易... – shadyyx
這似乎是最好的方式來做到這一點,除了我使用的ipn類看起來並不像它使用Paypal API [link] (http://www.micahcarrick.com/paypal-ipn-with-php.html) – JK36