Milice
Nutjob
Hi, i just made my server on linux and on linux does crying damson not support MySQL so i made a Sqlite script for Paypal donations, i will just release the ipn file since thats all thats needed, if you dont have the other files you can find them here: Paypal Script [RELEASE] By Artii
Here is the ipn.php file for SQLite:
This script is only tested on Linux.
Here is the ipn.php file for SQLite:
Code:
<?
// WHOLE SCRIPT REMADE FOR SQLITE BY MILICE
$custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
$receiver_email = $_REQUEST['receiver_email'];
$payment_status = $_REQUEST['payment_status'];
$mc_gross = $_REQUEST['mc_gross'];
$currency = $_REQUEST['mc_currency'];
// DB CONNECT
$dbplace = '/home/milice/Desktop/necronia/forgottenserver.s3db';
$db = new PDO('sqlite:'.$dbplace.'');
// END OF DB CONNECT
if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "5.0") {
$query = $db->query('SELECT * FROM accounts WHERE name = '.$custom.'')->fetch();
$currentpoints = $query['premium_points'];
$pointstogive = 5;
// $points = mysql_query($prem)
$query2 = $db->query('UPDATE accounts SET premium_points = '.$currentpoints.'+'.$pointstogive.' WHERE name = '.$custom.'');
}
else
{
echo("Error.");
}
?>
This script is only tested on Linux.
Code:
$pointstogive = 5;
Change the 5 to the points you want your player to recieve after donation.
if ($payment_status == "Completed" & $receiver_email == "[email protected]" & $mc_gross == "5.0")
change your email and change mc_gross to the amount your players donate.
$dbplace = '/home/milice/Desktop/necronia/forgottenserver.s3db';
change to where the sqlite database is located!