1
我正在使用表单将捐赠的item_name和金额发送到页面上的本地PHP脚本,但脚本只是将我发送到paypal.com而不是捐赠页面。 我没有看到任何错误,它都检查出来,但没有做它的工作。这里的本地脚本:cURL和PayPal无法正常工作
<?php
function datapost($URLServer,$postdata)
{
$agent = "Mozilla/5.0";
$cURL_Session = curl_init();
curl_setopt($cURL_Session, CURLOPT_URL,$URLServer);
curl_setopt($cURL_Session, CURLOPT_USERAGENT, $agent);
curl_setopt($cURL_Session, CURLOPT_POST, 1);
curl_setopt($cURL_Session, CURLOPT_POSTFIELDS,$postdata);
curl_setopt($cURL_Session, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($cURL_Session, CURLOPT_FOLLOWLOCATION, 1);
$result = curl_exec ($cURL_Session);
}
$htmlsource= datapost("https://www.paypal.com/cgi-bin/webscr","cmd=_donations&[email protected]¬ify_url=http://example.net/donate/paypal.php?action=ipn&return=http://example.net/donate/thankyou.php&rm=2&no_note=1&cbt=Back&no_shipping=1&lc=US¤cy_code=USD&item_name=".$_POST['item_name']."&amount=".$_POST['amount']."&bn=PP-DonationsBF:btn_donate_LG.gif:NonHostedGuest");
?>
而且形式将其发送:
<form action="http://example.net/beta/index.php" method="post" class="payPalForm" id="paypal">
<div>
<div class="formRow">
<div class="hidden" id="error" style="width:100%"><h3> I'm sorry, that STEAM ID you entered was incorrect.</h3></div>
</div>
<div class="formRow">
<label for="field0">
Steam ID<span class="star">*</span>: </label>
<input type="text" name="item_name" id="item_name" class="textField required" />
</div>
<div class="formRow">
<label for="field2">
Amount: </label>
<select name="amount" id="field2" class="select">
<option value="5">$5</option>
<option value="10">$10</option>
<option value="15">$15</option>
<option value="20">$20</option>
<option value="25">$25</option>
<option value="30">$30</option>
<option value="35">$35</option>
</select>
</div>
<div class="formRow">
<input type="submit" value="Donate" id="donatebtn" onclick="return verifySteamID()" />
</div>
</form>
它发送到脚本否则就不能去paypal.com因为没有说明其他地方。我不明白为什么它不工作,有什么想法?
没人?不是一个人?! – Harry