Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- boats and more boats
- <?php
- $amount = $_REQUEST['']; // in gbp -- get this from paypal
- $actname = $_REQUEST['']; //account name for vip -- get this from paypal
- $month_donation = 2.50;
- $months = 0;
- for ($i = 0; $amount > $month_donation; ;) { // for every 2.50 they give, they get 1 month.
- $months++;
- $amount = $amount - $month_donation;
- }
- if (!$amount == 0) {
- $r = $amount / $month_donation;
- }
- // r is the excess amount (not a multiple of 2.50GBP)
- // r is an integer from 0 to 1. multiply it by the amount of days in the month to get extra days.
- // total amount time: $months months and $r days.
- $mysql_database = "";
- $mysql_user = "";
- $mysql_host = "localhost";
- $mysql_password = ""; // this is secure. users cannot view php source code
- $connection = mysql_connect($mysql_host, $mysql_user, $mysql_password); // open the conncetion
- if (!$connection) {
- die("Failed to connect to database server.");
- } // else, continue adding their time
- $select = mysql_select_db($mysql_database);
- if (!$select) {
- die("Failed to open database!");
- }
- $query = "..."; // alex: write the database query here
- $result = mysql_query($query);
- if (!$query) {
- die("Failed to connect to write to database.");
- } else {
- echo "The account " + $actname + " has been credited with " + $months + " months and " + $r + " days V.I.P. status on the Dawncraft Server.";
- echo "</br> Thank you for your support!";
- }
- mysql_close($connection);
- $mysql_database = "";
- $mysql_user = "";
- $mysql_host = "";
- $mysql_password = ""; //white these out just in case.
- ?>
Add Comment
Please, Sign In to add comment