Jump to content


Return Data from a Donation.

  • This topic is locked This topic is locked
1 reply to this topic

#1 chriskona



  • Members
  • Pip
  • 1 posts

Posted 12 March 2004 - 12:44 PM

I have a donation button on my site, and after a donation is made, paypal does not post anything back like IPN claims.

Here is my code, and please let me know what im doing wrong.

Here is my HTML Code.

<form ACTION="https://www.paypal.com/cgi-bin/webscr" METHOD="POST" id="form1" name="form1">
<input TYPE="hidden" NAME="cmd" VALUE="_xclick">
<input TYPE="hidden" NAME="business" VALUE="paypal@mydomain.com">
<input TYPE="hidden" NAME="return" VALUE="http://www.mydomain.com/paypal.php">
<input TYPE="hidden" NAME="item_name" VALUE="Donation to AutoRush.com">
<input TYPE="hidden" NAME="item_number" VALUE="AutoRush_DONATE">
<input TYPE="hidden" NAME="cancel_return" VALUE="http://www.mydomain.com">
<input TYPE="image" SRC="http://images.paypal.com/images/x-click-but04.gif" BORDER="0" NAME="submit" ALT="Donate to AutoRush with Pa
yPal - it's fast, free and secure!">

Here is paypal.php

$payment_amount = $_POST['mc_gross'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];

$message_part1 = "receiver_email = $receiver_email\npayer_email = $payer_email\nfirst_name = $first_name\nlast_name= $last_name\nget
= $get\npayment_amount = $payment_amount\n\n";

// this is debug to get any POST data and email me it.
while (list($key, $value) = each ($_POST)) {
$a .= "$key - $value\n";

$message_part2 = "This is an Array\n\n$a";

$message = "".$message_part1." \n\n ".$message_part2."\n";


$insert="insert into donate values(NULL,'$payment_amount','$first_name','$last_name')";

echo "<BR><BR>$font<center>Thank you, $first_name $last_name for your donation.!!</center><BR>";
} else {
echo "$font <BR><BR>ERROR From paypal. This does not mean your donation didnt go though, it just means I had
an error trying to insert your information into my database.";

Thank you-

#2 PayPal_Paulam


    Average Member

  • Members
  • 511 posts

Posted 17 March 2004 - 10:51 AM

Hi chriskona,

Is that the complete code that you have for IPN?. Because based on that code you are not using IPN. For IPN sample code visit www.paypal.com/ipn.

Now, if you just using the return url to retrieve the information then you are missing one variable on your HTML code. You need to have 'rm' set to 2. For more information on how 'rm' variable works go to https://www.paypal.c...single_item.pdf page 37.

PayPal Tech Support Agent
PayPal an eBay company

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users