you would need something like this and you need to setup IPN in your paypal
this is a code from my phpMyBitTorrent
PHP Code:
<?php
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
foreach ($_POST as $key => $value) {
$value = urlencode(stripslashes($value));
$req .= "&$key=$value";
}
// post back to PayPal system to validate
$header .= "POST /cgi-bin/webscr HTTP/1.0\r\n";
$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
$fp = fsockopen ('www.paypal.com', 80, $errno, $errstr, 30);
// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
if (!$fp) {
// HTTP ERROR
} else {
fputs ($fp, $header . $req);
while (!feof($fp)) {
$res = fgets ($fp, 1024);
if (strcmp ($res, "VERIFIED") == 0) {
if ($receiver_email == $paypal_email){
# $query = "UPDATE ".$db_prefix."_users SET donated = donated + '$payment_amount' where id='$clid'";
# $result = mysql_query($query);
$query = "UPDATE ".$db_prefix."_paypal SET reseaved_donations = reseaved_donations + '$payment_amount' ";
$result = mysql_query($query);
}
header("Location: ".$siteurl."");
}
else if (strcmp ($res, "INVALID") == 0) {
}
}
fclose ($fp);
}
?>
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in
BT.Manager™ forum
My Current Demo is here
http://demo.btmanager.org/