• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Stian's (?) PayPal script help..

Joined
Jun 19, 2009
Messages
1,852
Reaction score
5
Hello!

I use Stian's (not sure if it's his script but he is the one who gave me it) PayPal script. When people donates, I receive the money but they doesn't get the points automatically...

perhaps there is something wrong in my ipn.php:

PHP:
<?php
if ($_REQUEST['debug']) {
ini_set("display_errors", True);
error_reporting(E_ALL);
}
$mysql_host = 'localhost'; //Leave at localhost  
$mysql_user = 'root'; //DB User  
$mysql_pass = '***/'; //DB Pass  
$mysql_db = 'test'; //DB Name  
$file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file 
$payer_email = $_REQUEST['payer_email']; 
$ip = $_SERVER['REMOTE_ADDR'];
if($ip != "66.211.170.66" && $ip != "216.113.188.202" && $ip != "216.113.188.203" && $ip != "216.113.188.204") {
	print "Scammer...";
$hak = fopen("scammer.log", "a");
fwrite($hak, "$ip \r\n");
fclose($hak);
die(0);
}
$time = date("F j, Y, g:i a"); 
$paylist = array("12.00" => 20);

// connect db  

$db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);

$custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));  
$receiver_email = $_REQUEST['receiver_email'];  
$payment_status = $_REQUEST['payment_status'];  
$mc_gross = $_REQUEST['mc_gross']; 
mysql_select_db($mysql_db, $db);  
if ($_REQUEST['debug']){
print $payment_status . '\n';
print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
print $receiver_email . '\n';
print $custom . '\n';
}
if ($payment_status == "Completed" && $receiver_email == "[email protected]" && isset($paylist[$mc_gross])) {  

$query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";  

$result = mysql_query($query);  

$prem = mysql_fetch_array($result);  
$somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";

// figure out how much to give
$give = $paylist[$mc_gross];
$points = $prem['premium_points'] + $give;  
// $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);  
}  
else  
 {   
 echo("Error.");  
 }  
?>

or paypal.htm:

HTML:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="hehehehe@hotmail...">
<input type="hidden" name="lc" value="EUR">
<input type="hidden" name="item_name" value="Forgottens Donations">
<b>Account name/login:</b> <input type="text"  name="custom" value="">

<select name="amount">
  <option value="12.00">12 EUR</option>
</select>
<input type="hidden" name="button_subtype" value="products">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_shipping" value="1">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="notify_url" value="http://forgottens.hopto.org/paypal/ipn/ipn.php">
<input type="hidden" name="return" value="http://forgottens.hopto.org/?subtopic=shopsystem">
<input type="hidden" name="rm" value="0">
<input type="hidden" name="bn" value="PP-BuyNowBF:btn_buynowCC_LG.gif:NonHostedGuest">
<input type="image" src="https://www.paypal.com/en_US/i/btn/btn_buynowCC_LG.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>

People donates 12 EUR for 20 points.. I think I have done everything correctly.
 
PHP:
$points = $prem['premium_points'] + $give;
Shouldn't $give be the amount of Points they get? Or am I mistaken?
 
Sure :)
ipn.php
PHP:
<?  
$mysql_host = 'localhost'; //Leave at localhost  
$mysql_user = 'root'; //DB User  
$mysql_pass = '*********'; //DB Pass  
$mysql_db = '*******'; //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 == "*********@******.**" & $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'] + 40;  
// $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);  
}  
else  
 {   
 echo("Error.");  
 }  
?>
 
Sure :)
ipn.php
PHP:
<?  
$mysql_host = 'localhost'; //Leave at localhost  
$mysql_user = 'root'; //DB User  
$mysql_pass = '*********'; //DB Pass  
$mysql_db = '*******'; //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 == "*********@******.**" & $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'] + 40;  
// $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);  
}  
else  
 {   
 echo("Error.");  
 }  
?>

and the *important* part of paypal.htm?:p
 
Hmm, I made the script like a half year ago, based on a not so working script Eternia used (dunno who made that). and I've used it for 3-4 servers after that. Works just fine.

You could try remove all the log functions, might not work on Windows (I never tested it on Windows).
 
and the *important* part of paypal.htm?:p

Whoops forgot that xDDDD.
HTML:
<b>Automatic PayPal Donation System.</b><br><br>
The donation costs 10 EUR (incl. VAT).<br>
After the donation you will receive <b>38 points + 2 bonus points (Tot. 40 points)</b> in your account automatically. <br>Because you donate with PayPal / Creditcard you will receive +2 extra bonus points for free.<br><br>

<b>Here are the steps you need to make:</b> <br>
1. You need a valid creditcard <b>or</b> a PayPal account with a required balance [10 EUR]. <br>
2. Fill in your account number/name. <br>
3. Click on the donate button. <br>
4. Make a transaction on PayPal. <br>
5. After the transaction 40 points will be automatically added to your account. <br>
6. Go to Item shop and use your points <br> <br> <br> </b>

<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_donations">
<input type="hidden" name="business" value="**************">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="item_name" value="***** *******">
<b>Account number:</b> <input type="text"  name="custom" value="">
<input type="hidden" name="item_number" value="1">
<input type="hidden" name="amount" value="10.0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="no_note" value="0">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="currency_code" value="EUR">
<input type="hidden" name="notify_url" value="http://*********/ipn/ipn.php">
<input type="hidden" name="return" value="http://*******">
<input type="hidden" name="rm" value="0">
<input type="hidden" name="bn" value="PP-DonationsBF:btn_donateCC_LG_global.gif:NonHosted">
<input type="image" src="images/paypal_donate_button.gif" border="0" name="submit" alt="PayPal - The safer, easier way to pay online.">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
 
no but I copyd the script above from Korrex but don't seem to find where I need to place my Paypal email account , and do I have to add something in my msql?

You should edit the HTML form to set your PayPal address and as well as the price. PayPal is pretty much doing the whole process for you; but certainly, you need a few lines of code to communicate with PayPal's servers.
 
Back
Top