Advertisement
Guest User

Untitled

a guest
Oct 3rd, 2017
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.03 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 = 'kf302it9JFm'; //DB Pass  
  9. $mysql_db = 'server'; //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"); // here you cna edit how many points will get players
  21. $paylist = array("6.00" => 50, "12.00" => 125, "15.00" => 175);
  22.  
  23. // connect db  
  24.  
  25. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  26.  
  27. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));  
  28. $receiver_email = $_REQUEST['receiver_email'];  
  29. $payment_status = $_REQUEST['payment_status'];  
  30. $mc_gross = $_REQUEST['mc_gross'];
  31. mysql_select_db($mysql_db, $db);  
  32. if ($_REQUEST['debug']){
  33. print $payment_status . '\n';
  34. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  35. print $receiver_email . '\n';
  36. print $custom . '\n';
  37. }
  38. if ($payment_status == "Completed" && $receiver_email == "bacheer_93@hotmail.com" && isset($paylist[$mc_gross])) {  
  39.  
  40. $query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";  
  41.  
  42. $result = mysql_query($query);  
  43.  
  44. $prem = mysql_fetch_array($result);  
  45. $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  46.  
  47. // figure out how much to give
  48. $give = $paylist[$mc_gross];
  49. $points = $prem['premium_points'] + $give;  
  50. // $points = mysql_query($prem)  
  51. $qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";  
  52. // Log Paypal Transaction
  53. $hak = fopen($file, "a");
  54. fwrite($hak, $somecode);
  55. fclose($hak);
  56.  
  57. $result2 = mysql_query($qry2);  
  58. }  
  59. else  
  60.  {  
  61.  echo("Error.");  
  62.  }  
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement