Advertisement
Guest User

Untitled

a guest
Jan 1st, 2021
316
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. <?php
  2. file_put_contents("datareceive.log",print_r($_POST,true));
  3. $authorized = array("198.148.82.98","198.148.82.99","104.28.15.89","173.245.58.198","173.245.59.206");
  4.  
  5.  
  6. if(!in_array($_SERVER["REMOTE_ADDR"],$authorized))
  7. exit();
  8.  
  9. $voterIP = mysql_real_escape_string($_POST["VoterIP"]); // voter ip address
  10. $success = abs($_POST["Successful"]); // 1 for error, 0 for successful
  11. $reason = $_POST["Reason"]; // log reason the vote failed
  12. // $pingUsername is a custom field you can use to track your players username or
  13. //id number.
  14. //
  15. // You can do this by changing your votebutton code link to whatever your players
  16. //username or id is.
  17. //
  18. // Simply add this line to the end of your voting url where yyy is your
  19. //players unique username or id ( &pingUsername=yyy ).
  20. //
  21. // Below is an example url of how it should look.
  22. // Example: [YourSiteDetailsPageURL]?vote=1&pingUsername=yyy
  23. $pingUsername = $_POST["pingUsername"];
  24.  
  25. $link = mysqli_connect("localhost", "root", "", "test");
  26.  
  27. // if successfull vote reward your user, use your own database!
  28. $result = mysqli_query($link, "SELECT name FROM accounts WHERE name = 'adminacc'");
  29. if($result !== FALSE) {
  30. $row = mysqli_fetch_row($result);
  31. if(is_array($row)) {
  32. if($success >= 0) {
  33. $reward = $mysqli->query("UPDATE accounts SET votepoints = votepoints + 1 WHERE name= 'adminacc'");
  34. }
  35. // Log reason here(optional)
  36. }
  37. mysqli_free_result($result);
  38. }
  39. mysqli_close($link);
  40. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement