Jump to content


Photo

Displaying Donors


  • This topic is locked This topic is locked
5 replies to this topic

#1 SpecialBlend

SpecialBlend

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 31 July 2005 - 12:32 PM

Hello everyone, I searched the forum but can't find any helpful information on this topic. I have seen modifications for PHPNuke and stuff but I need some straight up PHP. I know basic PHP but if given the code I can figure it out, or even if somebody can show me to a tutorial, because I have looked everywhere and can't find it. Anyways, I would like a script that uses IPN so that when somebody donates, once the process is Verified, it stores the Donors Name, Donation Amount, etc.. in my MySQL database. I know how to display the information from my database so I can do that. If anybody can help that would be great.

Regards,
Bryan.

www.sloaner.net - Your Source for Humorous Media

#2 GFC

GFC

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 15 March 2006 - 05:43 PM

yeah i would also like to get this code. please help...i r noob!

#3 GFC

GFC

    Newbie

  • Members
  • Pip
  • 3 posts

Posted 21 March 2006 - 04:34 AM

bump...still no answer!

#4 AuntieSocial

AuntieSocial

    Newbie

  • Members
  • Pip
  • 2 posts

Posted 11 April 2006 - 01:22 AM

trying to do the same here.

what I did:

added hidden field to the form,like this


<input name="custom" value="<? echo $uid; ?>" type="hidden">

the code to get the $uid (userid):
<?
if (pnUserLoggedIn()) {
$uid = pnSessionGetVar('uid');
} else {
$uid = 0;}
?>

if (pnUserLoggedIn()) is how I get the userid in my setup.
you'll have to write code that gets the logged in user's id# or username,depending on your setup and replace accordingly.

I wrote: else {
$uid = 0;} // this is for guests (hey you never know, a guest might just donate :P )

so... now my form looks like this:
************************************
<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="email@domain.com">
<input type="hidden" name="item_name" value="Donation">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="return" value="http://domain.com/thank_you.html">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="tax" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF">
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/x-click-but04.gif" border="0" name="submit" alt=" alt="Donate with PayPal">
<input name="notify_url" value="http://domain.com/donate/notify.php" type="hidden">
<?
if (pnUserLoggedIn()) {
$uid = pnSessionGetVar('uid');
} else {
$uid = 0;}
?>
<input name="custom" value="<? echo $uid; ?>" type="hidden">
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
*********************************************************


in notify.php I added:

$uid = $_POST["custom"];
$amount = $_POST['mc_gross'];

if ($uid == 0) {
$uname = "Guest";
} else {

$dbconn(); //connect to db

$result = mysql_query("SELECT uname FROM users WHERE uid = $uid");
$uname = mysql_result($result,0);
}

// this is my setup @ database
$sql = "INSERT INTO data (uid, username, amount, date) VALUES ('$uid', '$uname', '$amount', NOW())";
mysql_query($sql) or die('Error, insert query failed')

mysql_close($db);

************************************

then you write you code to display user,donation etc.

#5 BWWD2008

BWWD2008

    Member

  • Members
  • PipPip
  • 13 posts

Posted 23 February 2008 - 04:54 PM

You can find a really good paypal donation meter at http://www.PayPalDonationMeter.com

Multiple donation meters can be used on the same site, you can have multiple donation reasons and display how much collected for all or for each individual one, you can also collect and show a name of each donator and display the last x numbr of donors

More updates coming soon, there will be multiple new image packs coming out so you can have different donation meter display images and much more

PayPal Donation Meter - http://www.PayPalDonationMeter.com

There is also a new hosted version of the with simple easy to add code so you do not have to host and install the itself on your site and do not need php or mysql to run the as we do all that for you our end.

Hosted PayPal Donatione Meter - http://www.PayPalDon...ation-meter.php

#6 stellarwebsolutionsnet

stellarwebsolutionsnet

    Junior Member

  • Members
  • 194 posts

Posted 26 February 2008 - 09:46 AM

Take a look at http://www.stellarwe...s.php#donations

Tyler
Stellar Web Solutions - e-Solutions for e-Commerce
Secure Payment, Ordering, Shipping, Electronic Goods Delivery
http://www.stellarwebsolutions.com/

Track PayPal Donations Live http://www.stellarwe...en/products.php




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users