Gamehot
✨ Advertise 💎 Premium
Login Register

Popular Games

  • Minecraft server list Minecraft
  • Ragnarok Private Servers Ragnarok
  • RSPS List RuneScape Private Servers RuneScape
  • Perfect World Private Servers Perfect World
  • World of Warcraft server list World of Warcraft
  • Silkroad Online Private Servers - SRO Private Servers Silkroad
  • MU Online Private Servers MU Online
  • Metin2 Private Servers Metin2
  • Cabal Online Private Servers Cabal
  • Conquer Private Servers Conquer
  • Aion Private Servers Aion
  • Last Chaos Private Servers Last Chaos
  • Flyff Private Servers Flyff
  • MMORPG & MPOG Private Servers MMORPG & MPOG
  • OGame Private Servers OGame
  • Ran Online Private Servers Ran Online

How Does Callback Work?

To implement postback functionality, you'll need a script on your server that is called when someone votes for you. Below is a PHP example for basic integration based on the default callback.

Default Callback:

This method works for most of our website users. Simply pass the voter’s username/ID along with the vote link.

  • Place your callback URL (web accessible URL of the script you created) within your server settings.
  • Let your users vote using the following URL:
[YOUR-SERVER-VOTE-URL]?user=[PLAYER-ID]
  • Replace [YOUR-SERVER-VOTE-URL] with your server setting.
  • Replace [PLAYER-ID] with the ID that you use to identify your player.
Default Callback is ready to use!

Example PHP Postback Script

    

        <?php
        #Example PHP Postback Script

        // Your Database Connection Details
        $host = 'localhost';
        $db_name = '';
        $db_user = '';
        $db_password = '';
        $connection = mysqli_connect($host, $db_user, $db_password);
        mysqli_select_db($connection, $db_name);

        // User
        $userid = isset($_POST['userid']) ? $_POST['userid'] : null;

        // User IP
        $userip = isset($_POST['userip']) ? $_POST['userip'] : null;

        // User voted on Gamehot? 1 = unique vote, 0 = already voted
        $valid = isset($_POST['voted']) ? (int)$_POST['voted'] : 0;

        // Make sure the user was not yet rewarded on your system
        // For example by checking your reward logs
        if (!is_null($userid) && $valid == 1)
        {
            // Make userid safe to use in query
            $userid = mysqli_real_escape_string($connection, $userid);

            // COUNT rows where reward_date is today
            $result = mysqli_query($connection, "SELECT COUNT(*) FROM `reward_log` WHERE `user` = '$userid' AND `reward_date` >= CURDATE()");
            $rewarded = mysqli_num_rows($result);

            // No results means not rewarded yet, so grant reward and set the reward date/time log
            if(!$rewarded)
            {
                 // Grant reward, for example vote points
                mysqli_query($connection, "UPDATE `users` SET `points` = `points` + 1 WHERE `user` = '$userid'");

                 // Insert log
                mysqli_query($connection, "INSERT INTO `reward_log` (`user`, `reward_date`) VALUES ('$userid', NOW())");
            }
        }

        // Close connection
        mysqli_close($connection);

        ?>
    
  

Test Callback

Logo

Gamehot.net - The best mmo games with private servers, promote with us your online game and private server for free. Listing the best mmo game private servers available online. The best free mmorpg private servers ranked in order of quality and popularity.

Game & Category

  • Minecraft server list Minecraft
  • Ragnarok Private Servers Ragnarok
  • RSPS List RuneScape Private Servers RuneScape
  • Perfect World Private Servers Perfect World
  • World of Warcraft server list World of Warcraft
  • Silkroad Online Private Servers - SRO Private Servers Silkroad
  • MU Online Private Servers MU Online
  • Metin2 Private Servers Metin2
  • Cabal Online Private Servers Cabal
  • Conquer Private Servers Conquer
  • Aion Private Servers Aion
  • Last Chaos Private Servers Last Chaos
  • Flyff Private Servers Flyff
  • MMORPG & MPOG Private Servers MMORPG & MPOG
  • OGame Private Servers OGame
  • Ran Online Private Servers Ran Online
  • Shaiya Online Private Servers Shaiya
  • Travian Private Servers Travian

Copyright © 2022 GAMEHOT.NET All Rights Reserved.

Callback About Us TOS Privacy Policy Disclaimer Contact Us