Advertisement
Guest User

Untitled

a guest
May 15th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.32 KB | None | 0 0
  1. <?php
  2. if ($_REQUEST['debug']) {
  3. ini_set("display_errors", true);
  4. error_reporting(E_ALL);
  5. }
  6.  
  7. // GIVE HERE YOUR DB INFO
  8.  
  9. $mysql_host = 'localhost'; //Leave at localhost
  10. $mysql_user = '-----'; //DB User
  11. $mysql_pass = '-------'; //DB Pass
  12. $mysql_db = '-------'; //DB Name
  13.  
  14. $file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file
  15. $payer_email = $_REQUEST['payer_email'];
  16. $ip = $_SERVER['REMOTE_ADDR'];
  17. if($ip != "66.211.170.66" && $ip != "216.113.188.202" && $ip != "216.113.188.203" && $ip != "216.113.188.202" && $ip != "173.0.81.1" && $ip != "notify.paypal.com" && $ip != "73.0.81.33" && $ip != "173.0.81.33" ) {
  18. print "Acess restricted";
  19. $hak = fopen("scammer.log", "a");
  20. fwrite($hak, "$ip \r\n");
  21. fclose($hak);
  22. die(0);
  23. }
  24. $time = date("F j, Y, g:i a");
  25. // REMEBER THERE ARE DOTS AND TWO ZEROS
  26. $paylist = array("0.01" => 500, "10.20" => 1000, "20.70" => 2000, "40.80" => 3000);
  27.  
  28. // connect db
  29.  
  30. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  31.  
  32. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
  33. $receiver_email = $_REQUEST['receiver_email'];
  34. $payment_status = $_REQUEST['payment_status'];
  35.  
  36. // currency
  37.  
  38. $currency = $_REQUEST['mc_currency'];
  39.  
  40. $mc_gross = $_REQUEST['mc_gross'];
  41. mysql_select_db($mysql_db, $db);
  42. if ($_REQUEST['debug']){
  43. print $payment_status . '\n';
  44. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  45. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  46. print $receiver_email . '\n';
  47. print $custom . '\n';
  48. }
  49. // GIVE HERE YOUR MAIL
  50. if ($payment_status == "Completed" && $receiver_email == "PUT YOUR EMAIL" && $currency == "EUR" && isset($paylist[$mc_gross]))
  51. {
  52.  
  53. $query = "SELECT premium_points FROM accounts WHERE accounts.id = '$custom'";
  54.  
  55. $result = mysql_query($query);
  56.  
  57. $prem = mysql_fetch_array($result);
  58. $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  59.  
  60. // figure out how much to give
  61. $give = $paylist[$mc_gross];
  62. $points = $prem['premium_points'] + $give;
  63. // $points = mysql_query($prem)
  64. $qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.id = '$custom'";
  65. // Log Paypal Transaction
  66. $hak = fopen($file, "a");
  67. fwrite($hak, $somecode);
  68. fclose($hak);
  69. $result2 = mysql_query($qry2);
  70.  
  71. }
  72.  
  73. else
  74. {
  75. echo("Error.");
  76. }
  77. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement