<?php
$action=$_REQUEST['action'];
if ($action=="")
{
?>
<center>
<form name="_xclick" action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="example@example.com">
<input type="hidden" name="currency_code" value="AUD">
<input type="hidden" name="item_name" value="Donation">
<input type="number" name="amount" value="10">
<br>
<input type="image" src="http://www.bgclubfc.org/donate-Now.gif" width="150px" height="50px" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
</form>
</center>
<?php
}
else
{
$amount=$_REQUEST['amount'];
if (($amount==""))
{
echo "All fields are required, please fill <a href=\"\">the form</a> again.";
}
else{
mail("example@example", "donation", $amount);
echo "Email sent!";
}
}
?>
好的,这是我的代码。这是一个有效的贝宝捐赠按钮。但我想在收到捐款时收到并通过电子邮件发送捐款金额。因此,当他们提交表单或单击立即捐赠按钮时,我希望收到一封包含输入内容的电子邮件。
谢谢