Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- file_put_contents("datareceive.log",print_r($_POST,true));
- $authorized = array("198.148.82.98","198.148.82.99","104.28.15.89","173.245.58.198","173.245.59.206");
- if(!in_array($_SERVER["REMOTE_ADDR"],$authorized))
- exit();
- $voterIP = mysql_real_escape_string($_POST["VoterIP"]); // voter ip address
- $success = abs($_POST["Successful"]); // 1 for error, 0 for successful
- $reason = $_POST["Reason"]; // log reason the vote failed
- // $pingUsername is a custom field you can use to track your players username or
- //id number.
- //
- // You can do this by changing your votebutton code link to whatever your players
- //username or id is.
- //
- // Simply add this line to the end of your voting url where yyy is your
- //players unique username or id ( &pingUsername=yyy ).
- //
- // Below is an example url of how it should look.
- // Example: [YourSiteDetailsPageURL]?vote=1&pingUsername=yyy
- $pingUsername = $_POST["pingUsername"];
- $link = mysqli_connect("localhost", "root", "", "test");
- // if successfull vote reward your user, use your own database!
- $result = mysqli_query($link, "SELECT name FROM accounts WHERE name = 'adminacc'");
- if($result !== FALSE) {
- $row = mysqli_fetch_row($result);
- if(is_array($row)) {
- if($success >= 0) {
- $reward = $mysqli->query("UPDATE accounts SET votepoints = votepoints + 1 WHERE name= 'adminacc'");
- }
- // Log reason here(optional)
- }
- mysqli_free_result($result);
- }
- mysqli_close($link);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement