Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
489
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.08 KB | None | 0 0
  1. <?php
  2. if ($_REQUEST['debug'])
  3.     {
  4.         ini_set("display_errors", True);
  5.         error_reporting(E_ALL);
  6.     }
  7. $mysql_host = 'localhost'; //Leave at localhost  
  8. $mysql_user = 'root'; //DB User  
  9. $mysql_pass = 'anco'; //DB Pass  
  10. $mysql_db = 'Server'; //DB Name  
  11. $file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file
  12. $payer_email = $_REQUEST['payer_email'];
  13.  
  14. $ip = $_SERVER['REMOTE_ADDR'];
  15.  
  16. $ip = str_replace('::ffff:', '', $ip);
  17.  
  18. echo $ip . '<br>';
  19.  
  20. if($ip != "66.211.170.66" && $ip != "216.113.188.202" && $ip != "216.113.188.203" && $ip != "216.113.188.202")
  21. {
  22.     print "Scammer...";
  23.     $hak = fopen("scammer.log", "a");
  24.     fwrite($hak, "$ip \r\n");
  25.     fclose($hak);
  26.     die(0);
  27. }
  28.  
  29. $time = date("F j, Y, g:i a");
  30. $paylist = array("05.00" => 10, "10.00" => 22, "15.00" => 34, "20.00" => 40);
  31.  
  32. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  33.  
  34. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));  
  35. $receiver_email = $_REQUEST['receiver_email'];  
  36. $payment_status = $_REQUEST['payment_status'];  
  37. $mc_gross = $_REQUEST['mc_gross'];
  38. mysql_select_db($mysql_db, $db);  
  39.  
  40. if ($_REQUEST['debug'])
  41. {
  42.     print $payment_status . '\n';
  43.     print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  44.     print $receiver_email . '\n';
  45.     print $custom . '\n';
  46. }
  47.  
  48. if ($payment_status == "Completed" && $receiver_email == "server@hotmail.com" && isset($paylist[$mc_gross]))
  49.     {  
  50.         $query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";  
  51.         $result = mysql_query($query);
  52.  
  53.         $prem = mysql_fetch_array($result);
  54.         $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  55.         // figure out how much to give
  56.         $give = $paylist[$mc_gross];
  57.         $points = $prem['premium_points'] + $give;  
  58.         // $points = mysql_query($prem)  
  59.         $qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";  
  60.         // Log Paypal Transaction
  61.         $hak = fopen($file, "a");
  62.         fwrite($hak, $somecode);
  63.         fclose($hak);
  64.         $result2 = mysql_query($qry2);  
  65.     }  
  66.     else  
  67.     {  
  68.         echo("Error.");  
  69.     }  
  70. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement