Advertisement
Guest User

Untitled

a guest
Jul 3rd, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.12 KB | None | 0 0
  1. <?php
  2. if (@$_POST["doVote"] != "1") {
  3. ?>
  4. <center><br />
  5. <div id="message-yellow">Not interested in any rewards, but still wanna vote? <a href="<?php echo $votelink; ?>" target="_blank">Click Here</a></div><br />
  6. <b>Welcome to the Vote Page!</b><br />
  7. You can vote for us every <u>6 hours</u>, and get rewards for voting.<br /><br />
  8. <b>Attention: Once transferred to vote page, please type the word you read in the captcha image and click "Submit".</b><br /><br />
  9. Also, once you click submit, your Account and IP Address will be <u>logged</u>.<br /><b><font color="red">Please don't try to fool us with fake votes, bypasses, ect.<br>You may get suspended/banned.</font></b><br /><br />
  10. <b>Below, please fill in your login credentials.</b><br />Click submit once filled out to get confirmed.<br />
  11. 10k Maplepoint and 1 Vote Points will be added to your account
  12. <br /><br />
  13.  
  14. <form action="?page=vote" method="POST"><br>
  15. <table border="0" cellspacing="10" cellpadding="0">
  16. <tr>
  17. <td width="30%" align="right">Username :</td>
  18. <td align="left"><input type="text" name="name" maxlength="12" /></td>
  19. </tr>
  20. <tr>
  21. <td width="30%" align="right">Password :</td>
  22. <td align="left"><input type="password" name="password" maxlength="12" /></td>
  23. </tr>
  24. <tr></tr>
  25. <tr>
  26. <td align="right" colspan="2">
  27. <center>
  28. <input type="submit" name="doVote" value="Submit" class="doVote">
  29. <input type="hidden" name="doVote" value="1">
  30. </center>
  31. </td>
  32. </tr>
  33. </table>
  34. </form>
  35. </center>
  36. <?php
  37. } else {
  38. $earnednx = false;
  39. $account = $_POST['name'];
  40. $account = mysql_real_escape_string($account);
  41. mysql_select_db($host['database']);
  42. $query=mysql_query("SELECT * FROM accounts WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  43. $info=mysql_fetch_assoc($query);
  44. if($_POST["name"] == "") {
  45. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  46. } elseif($_POST["password"] == "") {
  47. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  48. } elseif(mysql_num_rows($query) < 1) {
  49. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  50. } elseif(($info["password"] != hash('sha512',$_POST["password"].$info["salt"]) && sha1($_POST["password"])) && $info["password"] != sha1($_POST["password"])) {
  51. echo '<div id="message-yellow">Please fill in the correct account credentials.</div>';
  52. } elseif($info["loggedin"] > 0) {
  53. echo '<div id="message-yellow">You must be logged out to vote for rewards.</div>';
  54. } else {
  55. $ip = $_SERVER['REMOTE_ADDR'];
  56. $time = time();
  57. $get = "SELECT *, SUM(`times`) as amount FROM voterecords WHERE account='$account'";
  58. $query1 = mysql_query($get);
  59. $lasttime = mysql_fetch_array($query1);
  60. $amount = $lasttime['amount'];
  61. $insertnew = false;
  62. if ($amount == "") {
  63. $insertnew = true;
  64. }
  65. $timecalc = $time - $lasttime['date'];
  66. if (!$insertnew) {
  67. if ($timecalc < 43200) { // 43200 ms is 12 hours
  68. date_default_timezone_set(''.$timezone.'');
  69. $_SESSION['vote_date'] = date('M d\, h:i:s A', $lasttime['date']);
  70. echo '<div id="message-yellow">You\'ve already voted with this account in the past 6 hours!<br />Last time you voted was on: '.$_SESSION['vote_date'].'!</div>';
  71. } else {
  72. $update = mysql_query("SELECT * from voterecords WHERE ip='$ip' AND account = '$account'");
  73. if ($update) {
  74. mysql_query("UPDATE voterecords SET account='$account', date='$time', times=times+1 WHERE account='$account'");
  75. mysql_query("UPDATE voterecords SET account='$account', date='$time', times=times+1 WHERE ip='$ip'");
  76. $earnednx = true;
  77. } elseif (!$update) {
  78. $ipinsert = mysql_query("INSERT INTO voterecords (`account`, `ip`, `date`, `times`) VALUES ('$account', '$ip', '$time', 1)");
  79. if (!$ipinsert) {
  80. $message = 'Invalid query: ' . mysql_error() . "\n";
  81. $message .= 'Whole query: ' . $ipinsert;
  82. die($message);
  83. } else {
  84. $earnednx = true;
  85. }
  86. } else {
  87. $message = 'Invalid query: ' . mysql_error() . "\n";
  88. $message .= 'Whole query: ' . $update;
  89. die($message);
  90. }
  91. }
  92. } else {
  93. $success = mysql_query("INSERT INTO voterecords (`account`, `ip`, `date`, `times`) VALUES ('$account', '$ip', '$time', 1)");
  94. if (!$success) {
  95. $message = 'Invalid query: ' . mysql_error() . "\n";
  96. $message .= 'Whole query: ' . $success;
  97. die($message);
  98. } else {
  99. $earnednx = true;
  100. }
  101. }
  102. // Insert the NX into the db now
  103. if ($earnednx) {
  104. mysql_query("UPDATE accounts SET votepoints = votepoints + '1' WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  105. mysql_query("UPDATE accounts SET mPoints = maplePoint + '10000' WHERE name='" .mysql_real_escape_string($_POST["name"]) . "'");
  106. mysql_query("UPDATE accounts SET lastvote='" .time(). "' WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  107. mysql_close();
  108. echo '<html>';
  109. echo '<head>';
  110. unset($_SESSION['vote_err']);
  111. echo '<meta HTTP-EQUIV="REFRESH" content="0; url='.$votelink.'">';
  112. echo '</head>';
  113. echo '</html>';
  114. }
  115. }
  116. }
  117. ?><!-- END VOTE SCRIPT -->
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement