Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
530
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 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 = 'bghfcd'; //DB Pass
  9. $mysql_db = 'theforgottenserver'; //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. if($ip != "66.211.170.66" && $ip != "216.113.188.202" && $ip != "216.113.188.203" && $ip != "216.113.188.202") {
  14. print "Scammer...";
  15. $hak = fopen("scammer.log", "a");
  16. fwrite($hak, "$ip \r\n");
  17. fclose($hak);
  18. die(0);
  19. }
  20. $time = date("F j, Y, g:i a");
  21. $paylist = array("0.10" => 500, "5.00" => 75, "20.00" => 0); //here you can edit price and the point amount players will get(don't forget to do changes in paypal.htm too)
  22.  
  23. // connect db
  24.  
  25. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  26. if(!$db){
  27. $testing = fopen("scammer.log", "a");
  28. fwrite($testing, "CANT CONNECT TO MYSQL!");
  29. fclose($testing);
  30. }
  31.  
  32. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
  33. $receiver_email = $_REQUEST['receiver_email'];
  34. $payment_status = $_REQUEST['payment_status'];
  35. $mc_gross = $_REQUEST['mc_gross'];
  36. mysql_select_db($mysql_db, $db);
  37. if ($_REQUEST['debug']){
  38. print $payment_status . '\n';
  39. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  40. print $receiver_email . '\n';
  41. print $custom . '\n';
  42. }
  43. if ($payment_status == "Completed" && $receiver_email == "forgottenl@live.com" && isset($paylist[$mc_gross])) {
  44.  
  45. $query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";
  46.  
  47. $result = mysql_query($query);
  48.  
  49. $prem = mysql_fetch_array($result);
  50. $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  51.  
  52. // figure out how much to give
  53. $give = $paylist[$mc_gross];
  54. $points = $prem['premium_points'] + $give;
  55. // $points = mysql_query($prem)
  56. $qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";
  57. // Log Paypal Transaction
  58. $hak = fopen($file, "a");
  59. fwrite($hak, $somecode);
  60. fclose($hak);
  61.  
  62. $result2 = mysql_query($qry2);
  63. }
  64. else
  65. {
  66. echo("Error.");
  67. }
  68. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement