Gtop100 Logo
  • Games
    • 4Story
    • ACE Online
    • ARK Survival Evolved
    • Agario
    • Aion Online
    • Allods Online
    • Battle of the Immortals
    • Black Desert Online
    • Cabal Online
    • Clash of Clans
    • Conquer Online
    • Counter Strike
    • DarkOrbit
    • Dekaron
    • Dragon Nest
    • Dragonica Online
    • Dungeon Fighter Online
    • Eden Eternal
    • Flyff
    • Forsaken World
    • Free Online Games
    • Habbo Hotel
    • Helbreath
    • Iris Online
    • Jade Dynasty
    • Knight Online
    • Last Chaos
    • Latale
    • Legend Of Mir
    • Legends of Aria
    • Lineage 2
    • Luna Online
    • MMORPG And MPOG
    • MapleStory
    • Metin2
    • Minecraft
    • Mu Online
    • Night Crows
    • Ogame
    • Perfect World
    • Priston Tale
    • RF Online
    • Ragnarok Online
    • RaiderZ Online
    • Ran Online
    • Rappelz
    • Rohan
    • Rose Online
    • Runes of Magic
    • Runescape
    • Rust
    • Rusty Hearts
    • Seal Online
    • Shaiya
    • Silkroad Online
    • Swordsman
    • Tales Of Pirates
    • Tera
    • Terraria
    • Tibia
    • Travian
    • Ultima Online
    • War of the Immortals
    • Warhammer Online
    • World of Warcraft
  • Login

Pingback voting


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.

To verify voters using pingUsername, on your site details page on gtop100 where you vote, add
?vote=1&pingUsername=xyz to the url (replace xyz with the pingUsername of your choice)

You are allowed to use A-Z and 0-9 in the "&pingUsername" field, anything else might cause issues.

Below is an example code in PHP how your pingback file could look like.

<?php 
// This example is compatable with PHP 8 and can handle both receiving pingbacks via JSON and normal POST.
// It is highly recommended that you use receive pingbacks via JSON as it will lower the load on your server.
// It is important to use prepared statements to prevent SQL injection.
// Also, proper error handling should be implemented.
// success = 0 means that the vote was Successful, 1 means there was an issue.    

// Make sure you always return one of these http response codes:
// 200, 201, 202, 203 or 204
// This will prevent extra unnecessary requests to your server.

// We allow for: 80, 443 and 2000-6000 port ranges to receive pingbacks to your server.

If you are using JSON, a typical response might look like this: 
It is a multidimensional array where the first part contains consistent information, 
while 
the "Common" section includes up to 50 individual player votes.
{
    
"siteid": 12345,
    
"pingbackkey": "Your-Secret-Pingback-Key",
    
"Common":
    [
        [
            { 
"pb_id": 1 },
            { 
"ip": "1111:a11:1:a111:1a111:1a111:111:aaaa" },
            { 
"success": 0 },
            { 
"reason": "Vote accepted" },
            { 
"pb_name": "Player1" }
        ],
        [
            { 
"pb_id": 2 },
            { 
"ip": "111.11.11.111" },
            { 
"success": 0 },
            { 
"reason": "Vote accepted" },
            { 
"pb_name": "Player2" }
        ]
    ]
}

// Start of example code ->

$contentType = $_SERVER["CONTENT_TYPE"] ?? "";

// Receive data
if (strpos($contentType, "application/json") !== false) {
    
$data = json_decode(file_get_contents("php://input"), true);

    
// Handle JSON Data
    
if (!$data || !isset($data["Common"])) {
        
http_response_code(400);
        exit(
"Invalid JSON data.");
    }

    
$siteid = $data["siteid"] ?? null;
    
$pingbackkey = $data["pingbackkey"] ?? null;

    foreach (
$data["Common"] as $entry) {
        
$mappedData = [];
        foreach (
$entry as $subEntry) {
            
$mappedData = array_merge($mappedData, $subEntry);
        }

        
$voterIP = $mappedData["ip"] ?? null;
        
$success = abs((int)($mappedData["success"] ?? 1));
        
$reason = $mappedData["reason"] ?? null;
        
$pingUsername = $mappedData["pb_name"] ?? null;

        
processEntry($voterIP, $success, $reason, $pingUsername, $pingbackkey);
    }

    
http_response_code(200);
    exit(
"JSON data processed successfully.");

} else {
    
// Handle POST Data
    
$voterIP = $_POST["VoterIP"] ?? null;
    
$success = abs((int)($_POST["Successful"] ?? 1));
    
$reason = $_POST["Reason"] ?? null;
    
$pingUsername = $_POST["pingUsername"] ?? null;
    
$pingbackkey = $_POST["pingbackkey"] ?? null;

    
processEntry($voterIP, $success, $reason, $pingUsername, $pingbackkey);

    
http_response_code(200);
    exit(
"POST data processed successfully.");
}

function 
processEntry($voterIP, $success, $reason, $pingUsername, $pingbackkey) {
    if (
$pingbackkey !== "ENTER-YOUR-PINGBACKKEY-HERE") {
        
http_response_code(403);
        exit(
"Invalid pingback key.");
    }

    
$link = mysqli_connect("localhost", "user", "password", "db");

    if (!
$link) {
        
http_response_code(500);
        exit(
"Database connection error.");
    }

    
$query = "SELECT Username FROM UserTbl WHERE username = ?";
    
$stmt = mysqli_prepare($link, $query);

    if (
$stmt) {
        
mysqli_stmt_bind_param($stmt, "s", $pingUsername);

        if (
mysqli_stmt_execute($stmt)) {
            
$result = mysqli_stmt_get_result($stmt);

            if (
$row = mysqli_fetch_assoc($result)) {
                if (
$success == 0) {
                    
// send reward to $row["Username"]
                
}
                
// Optionally log reason here
            
} else {
                
// No user found
            
}

            
mysqli_free_result($result);
        } else {
            
http_response_code(500);
            exit(
"Failed to execute the query.");
        }

        
mysqli_stmt_close($stmt);
    } else {
        
http_response_code(500);
        exit(
"Failed to prepare the SQL query.");
    }

    
mysqli_close($link);
}

// End of example code <-

If you have any questions Contact Gtop100.
TOS  |   Privacy Policy |   About GTop100   

© GTOP100.COM - 2026. Trademarks are the property of their respective owners, all sites listed are added by users. Our editorial practices follow current best standards.