Boza
New Member
- Joined
- Feb 16, 2010
- Messages
- 184
- Reaction score
- 0
Ok this is what I'm trying to do. In the paypal.html file I just made two, with different prices and buttons.
I haven't tested anything but I would like to know if adding
and everything under it in ipn.php will work.
I haven't tested anything but I would like to know if adding
Code:
$points = $prem['premium_points'] + 2100;
Code:
<?
$mysql_host = 'xxxxx'; //Leave at localhost
$mysql_user = 'xxxxx'; //DB User
$mysql_pass = 'xxxxx'; //DB Pass
$mysql_db = 'xxxxx'; //DB Name
$file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file
$custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
$receiver_email = $_REQUEST['receiver_email'];
$payment_status = $_REQUEST['payment_status'];
$mc_gross = $_REQUEST['mc_gross'];
$payer_email = $_REQUEST['payer_email'];
$somecode = "'$custom' '$payer_email' '$mc_gross'";
// connect db
$db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
mysql_select_db($mysql_db, $db);
if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "##.##") {
$query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";
$result = mysql_query($query);
$prem = mysql_fetch_array($result);
$points = $prem['premium_points'] + 1000;
// $points = mysql_query($prem)
$qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";
// Log Paypal Transaction
$hak = fopen($file, "a");
fwrite($hak, $somecode);
fclose($hak);
$result2 = mysql_query($qry2);
$points = $prem['premium_points'] + 2100;
// $points = mysql_query($prem)
$qry3 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";
// Log Paypal Transaction
$hak = fopen($file, "a");
fwrite($hak, $somecode);
fclose($hak);
$result3 = mysql_query($qry3);
}
else
{
echo("Error.");
}
?>
Last edited: