Advertisement
Guest User

Untitled

a guest
Jul 31st, 2017
563
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 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 = 'test'; //DB Pass
  9. $mysql_db = 'test'; //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" && $ip != "173.0.81.1" ) {
  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("3.00" => 600, "5.00" => 1200, "10.00" => 2500);
  22.  
  23.  
  24. // connect db
  25.  
  26.  
  27. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  28.  
  29.  
  30. $custom = stripslashes(ucwords(strtolower(trim($_REQUEST['custom']))));
  31. $receiver_email = $_REQUEST['receiver_email'];
  32. $payment_status = $_REQUEST['payment_status'];
  33. $mc_gross = $_REQUEST['mc_gross'];
  34. mysql_select_db($mysql_db, $db);
  35. if ($_REQUEST['debug']){
  36. print $payment_status . '\n';
  37. print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  38. print $receiver_email . '\n';
  39. print $custom . '\n';
  40. }
  41. if ($payment_status == "Completed" && $receiver_email == "test@live.se" && isset($paylist[$mc_gross])) {
  42.  
  43.  
  44. $query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";
  45.  
  46.  
  47. $result = mysql_query($query);
  48.  
  49.  
  50. $prem = mysql_fetch_array($result);
  51. $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  52.  
  53.  
  54. // figure out how much to give
  55. $give = $paylist[$mc_gross];
  56. $points = $prem['premium_points'] + $give;
  57. // $points = mysql_query($prem)
  58. $qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";
  59. // Log Paypal Transaction
  60. $hak = fopen($file, "a");
  61. fwrite($hak, $somecode);
  62. fclose($hak);
  63.  
  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