简体   繁体   English

贝宝API,PHP,表格

[英]Paypal api, php, form

<?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!"; 


    } 
    }  
?> 

Okay here is my code. 好的,这是我的代码。 It is a working paypal donation button. 这是一个有效的贝宝捐赠按钮。 But I want to receive and email when ever a donation is made with the amount that was donated. 但是我希望在收到捐赠金额后通过电子邮件接收和发送电子邮件。 So when they submit the form or click the donate now button I want to receive an email with what the input was. 因此,当他们提交表单或单击立即捐赠按钮时,我希望收到一封包含输入内容的电子邮件。

Thank you 谢谢

Your question is very unclear, still from the code what i understand that you are trying to create paypal donate button. 您的问题尚不清楚,仍然从代码中得知,我了解您正在尝试创建贝宝捐赠按钮。

Please check below link useful for that. 请检查以下有用的链接。

https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/donation_buttons/ https://developer.paypal.com/webapps/developer/docs/classic/paypal-payments-standard/integration-guide/donation_buttons/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM