並感謝您的社區提供的巨大幫助。運行自己的PHP腳本按下貝寶現在購買按鈕
這是一個關於貝寶的問題。下面的代碼創建一個現在購買的非託管按鈕。我希望能夠運行我的geoTestArray.php代碼,當用戶按下「立即購買」按鈕時,而不是當按鈕顯示在頁面上時,該代碼目前只包括在內。
這可能嗎?
由於提前,
喬
<?php
include ('geoTestArray.php');
echo "<form action=\"https://www.paypal.com/cgi-bin/webscr\" method=\"post\">
<input type=\"hidden\" name=\"business\" value=\"[email protected]\">
<input type=\"hidden\" name=\"cmd\" value=\"$cmd\">
<input type=\"hidden\" name=\"amount\" value=\"$price\">
<input type=\"hidden\" name=\"shipping\" value=\"$shipping\">
<input type=\"hidden\" name=\"currency_code\" value=\"$currency\">
<input type=\"hidden\" name=\"shipto\" value=\"$shipto\">
<input type=\"hidden\" name=\"item_name\" value=\"$title\">";
if ($cmd == 'cart') {
echo "<input type=\"hidden\" name=\"add\" value=\"1\">";
}
include('./quantities2.php');
echo "<input type=\"hidden\" name=\"lc\" value=\"US\">
<input class=\"submit\" type=\"image\" src=\"$button\" border=\"0\" name=\"submit\" alt=\"$altaction\">
<img alt=\"\" border=\"0\" src=\"https://www.paypal.com/en_US/i/scr/pixel.gif\" width=\"1\" height=\"1\">
</form>";
?>
可能,但有可能是一個 更好的方法。 geoTestArray是做什麼的? –
它基本上找出了訪問瀏覽器的國家位置。由於我使用的是付費服務,因此當有人真的按下購買按鈕時,我只想使用令牌,而不是在頁面加載時使用。其實我已經有一個在腳本上執行的腳本,但這是一個JavaScript,而我的geoTestArray代碼是PHP,所以要麼做一個簡單的方法來做我想做的事情,要麼我會嘗試將我的PHP重寫爲JavaScript 。 – user1030520