1
votes
<?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="[email protected]">
<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

1
I have The email is not being sent. - reidjako

1 Answers

0
votes

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/