Here we will show you both which ip's that successfully voted and which ones that voted but failed, you will also be able know what went wrong.
With our pingback system you will know each time a voter has voted and which ip and/or username they have used.
A lot of things can go wrong when you vote, so all votes might not count, i have listed below the two most common things that result in a failed vote even when you enter the captcha and vote correctly:
Make sure that cookies and javascript is enabled in your browser!
If you are using the old in.php voting link, dont forget to login to you account and fetch the new voting code, otherwise this wont work!
You are NOT allowed to use email addresses in the "&pingUsername" field, everything else is ok!
Below is an example code in PHP how your pingback file could look like.
<?php
//$authorized = array("198.148.82.98","198.148.82.99"); // authorized ips to prevent exploitation
//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", "user", "password", "db");
// if successfull vote reward your user, use your own database!
$result = mysqli_query($link, "SELECT Username FROM UserTbl WHERE LastIP = "{$voterIP}"");
if($result !== FALSE) {
$row = mysqli_fetch_row($result);
if(is_array($row)) {
if($success == 0) {
// send reward to $row["Username"]
}
// Log reason here(optional)
}
mysqli_free_result($result);
}
mysqli_close($link);
?>