Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2017
543
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 KB | None | 0 0
  1. <?php
  2. if ($_REQUEST['debug']) {
  3. ini_set("display_errors", True);
  4. error_reporting(E_ALL);
  5. }
  6. $mysql_host = 'localhost'; //Leave at localhost
  7. $mysql_user = 'root'; //DB User
  8. $mysql_pass = 'x'; //DB Pass
  9. $mysql_db = 'x'; //DB Name
  10. $file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file
  11. $payer_email = $_REQUEST['payer_email'];
  12. $ip = $_SERVER['REMOTE_ADDR'];
  13. $ips = array('66.211.170.66', '216.113.188.202', '216.113.188.203', '216.113.188.204', '216.113.188.205', '66.135.197.163', '66.135.197.164', ' 66.135.197.162', '66.135.197.141', '216.113.191.33');
  14. if(!in_array($ip, $ips)) {
  15. print "Scammer...";
  16. $hak = fopen("scammer.log", "a");
  17. fwrite($hak, "$ip \r\n");
  18. fclose($hak);
  19. die(0);
  20. }
  21. $time = date("F j, Y, g:i a");
  22. $paylist = array("5.00" => 25, "10.00" => 50, "15.00" => 75, "20.00" => 100, "25.00" => 125, "30.00" => 150, "35.00" => 175, "40.00" => 200, "45.00" => 225, "50.00" => 275);
  23.  
  24. // connect db
  25.  
  26. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  27.  
  28. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
  29. $receiver_email = $_REQUEST['receiver_email'];
  30. $payment_status = $_REQUEST['payment_status'];
  31. $mc_gross = $_REQUEST['mc_gross'];
  32. $mc_currency = $_REQUEST['mc_currency'];
  33. mysql_select_db($mysql_db, $db);
  34. if ($_REQUEST['debug']){
  35. print $payment_status . '\n';
  36. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  37. print $receiver_email . '\n';
  38. print $custom . '\n';
  39. }
  40. if ($payment_status == "Completed" && $receiver_email == "JDB__@live.com" && isset($paylist[$mc_gross]) && $mc_currency == "EUR") {
  41. $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  42.  
  43. $qry2 = "UPDATE accounts SET premium_points = premium_points + {$paylist[$mc_gross]} WHERE name = '$custom'";
  44. // Log Paypal Transaction
  45. $hak = fopen($file, "a");
  46. fwrite($hak, $somecode);
  47. fclose($hak);
  48.  
  49. $result2 = mysql_query($qry2);
  50. }
  51. else
  52. {
  53. echo("Error.");
  54. }
  55. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement