Guest User

Untitled

a guest
Jun 1st, 2018
410
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.53 KB | None | 0 0
  1. boats and more boats
  2. <?php
  3. $amount = $_REQUEST['']; // in gbp -- get this from paypal
  4. $actname = $_REQUEST['']; //account name for vip -- get this from paypal
  5. $month_donation = 2.50;
  6. $months = 0;
  7. for ($i = 0; $amount > $month_donation; ;) { // for every 2.50 they give, they get 1 month.
  8. $months++;
  9. $amount = $amount - $month_donation;
  10. }
  11. if (!$amount == 0) {
  12. $r = $amount / $month_donation;
  13. }
  14. // r is the excess amount (not a multiple of 2.50GBP)
  15. // r is an integer from 0 to 1. multiply it by the amount of days in the month to get extra days.
  16. // total amount time: $months months and $r days.
  17.  
  18. $mysql_database = "";
  19. $mysql_user = "";
  20. $mysql_host = "localhost";
  21. $mysql_password = ""; // this is secure. users cannot view php source code
  22. $connection = mysql_connect($mysql_host, $mysql_user, $mysql_password); // open the conncetion
  23. if (!$connection) {
  24. die("Failed to connect to database server.");
  25. } // else, continue adding their time
  26.  
  27. $select = mysql_select_db($mysql_database);
  28. if (!$select) {
  29. die("Failed to open database!");
  30. }
  31. $query = "..."; // alex: write the database query here
  32. $result = mysql_query($query);
  33. if (!$query) {
  34. die("Failed to connect to write to database.");
  35. } else {
  36. echo "The account " + $actname + " has been credited with " + $months + " months and " + $r + " days V.I.P. status on the Dawncraft Server.";
  37. echo "</br> Thank you for your support!";
  38. }
  39. mysql_close($connection);
  40. $mysql_database = "";
  41. $mysql_user = "";
  42. $mysql_host = "";
  43. $mysql_password = ""; //white these out just in case.
  44. ?>
Add Comment
Please, Sign In to add comment