Advertisement
Guest User

Untitled

a guest
Jul 12th, 2017
482
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 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. }else{
  31. $testing = fopen("scammer.log", "a");
  32. fwrite($testing, "yes we can!");
  33. fclose($testing);}
  34.  
  35. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
  36. $receiver_email = $_REQUEST['receiver_email'];
  37. $payment_status = $_REQUEST['payment_status'];
  38. $mc_gross = $_REQUEST['mc_gross'];
  39. mysql_select_db($mysql_db, $db);
  40. if ($_REQUEST['debug']){
  41. print $payment_status . '\n';
  42. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  43. print $receiver_email . '\n';
  44. print $custom . '\n';
  45. }
  46. if ($payment_status == "Completed" && $receiver_email == "forgottenl@live.com" && isset($paylist[$mc_gross])) {
  47.  
  48. $query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";
  49.  
  50. $result = mysql_query($query);
  51.  
  52. $prem = mysql_fetch_array($result);
  53. $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  54.  
  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.  
  65. $result2 = mysql_query($qry2);
  66. }
  67. else
  68. {
  69. echo("Error.");
  70. }
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement