Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
560
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.10 KB | None | 0 0
  1. <?php
  2. //if ($_REQUEST['debug'])
  3. //  {
  4.         ini_set("display_errors", True);
  5.         error_reporting(E_ALL);
  6. //  }
  7. $mysql_host = 'localhost'; //Leave at localhost  
  8. $mysql_user = 'root'; //DB User  
  9. $mysql_pass = 'anco'; //DB Pass  
  10. $mysql_db = 'Server'; //DB Name  
  11. $file = 'paypal.log'; //Paypal Log Name will be placed in the same location as your ipn.php file
  12. $payer_email = $_REQUEST['payer_email'];
  13.  
  14. $ip = $_SERVER['REMOTE_ADDR'];
  15.  
  16. $ip = str_replace('::ffff:', '', $ip);
  17.  
  18. echo $ip . '<br>';
  19.  
  20. /*if($ip != "66.211.170.66" && $ip != "216.113.188.202" && $ip != "216.113.188.203" && $ip != "216.113.188.202")
  21. {
  22.     print "Scammer...";
  23.     $hak = fopen("scammer.log", "a");
  24.     fwrite($hak, "$ip \r\n");
  25.     fclose($hak);
  26.     die(0);
  27. }
  28. */
  29.  
  30. $time = date("F j, Y, g:i a");
  31. $paylist = array("05.00" => 10, "10.00" => 22, "15.00" => 34, "20.00" => 40);
  32.  
  33. $db = mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  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.  
  41. //if ($_REQUEST['debug'])
  42. //{
  43.     print $payment_status . '\n';
  44.     print (isset($paylist[$mc_gross])) ? 1 : 0 . '\n';
  45.     print $receiver_email . '\n';
  46.     print $custom . '\n';
  47. //}
  48.  
  49. if ($payment_status == "Completed" && $receiver_email == "server@hotmail.com" && isset($paylist[$mc_gross]))
  50.     {  
  51.         //$query = "SELECT premium_points FROM accounts WHERE accounts.name = '$custom'";  
  52.         //$result = mysql_query($query);
  53.  
  54.         $prem = mysql_fetch_array($result);
  55.         $somecode = "'$time' '$custom' '$payer_email' '$mc_gross' '$ip'\r\n";
  56.         // figure out how much to give
  57.         $give = $paylist[$mc_gross];
  58.         $points = $prem['premium_points'] + $give;  
  59.         // $points = mysql_query($prem)  
  60.         //$qry2 = "UPDATE accounts SET premium_points = '$points' WHERE accounts.name = '$custom'";  
  61.         // Log Paypal Transaction
  62.         $hak = fopen($file, "a");
  63.         fwrite($hak, $somecode);
  64.         fclose($hak);
  65.         //$result2 = mysql_query($qry2);  
  66.     }  
  67.     else  
  68.     {  
  69.         echo("Error.");  
  70.     }  
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement