Voting Check

Use Postback, CheckIP or Votifier to check if players are voting or not

Voting Check Systems

Check if users vote or not for your site or server by entering the captcha security code on voting gateway.
  1. Postback
  2. CheckIP
  3. Votifier


To set your postback URL simply edit your site or server configuration.

1. Set your Postback URL (on TopG):

You have to set this link in your server settings from Dashboard or on your server page on topg.

2. Update your voting link and add parameter to the end:
Your TopG voting link should have an extra - and PARAMETER on end. Copy the LINK from Voting Code and add -USERNAME or -123456 or whatever you keep track of (PARAMETER can be only numbers, leters and _ ). For example if I want to check if username "Razor" votes or not I make the link

3. Our response:

TopG will call your site after voting and the callback will look like this link:
We sent you back the same PARAMETER and the call is made ONLY if the user has voted for you. Your postback.php should UPDATE at this point the user PARAMETER as Valid. In case he didn't voted we don't send any response.


How your voting link should look like for User ID (first) or Username (second):

Our response, due first or second case, will be:
Conclusion: The player with account id 1234 or username Razor has voted for you in case we called your postback link with parameter.

Please read our PHP example to understand how to capture our response. We will send you the http request callback ONLY when the user has voted for you. If you need help setting this up please contact us.

postback.php example

define("DEBUG", 0); //set to 1 to enable debuger
define("LOG_FILE", "_postback.log"); //if debug is enabled will create this file for logs
define("TOPG_IP", gethostbyname("")); //This is TopG IP address

$ip_request = $_SERVER['REMOTE_ADDR']; //get postback caller IP address
if($ip_request == TOPG_IP) //check if response is coming from TopG
	if(DEBUG == true) {	error_log(date('[Y-m-d H:i] '). "[OK] Valid callback: $ip_request" . PHP_EOL, 3, LOG_FILE);	 }
	//connect to database
	//get the parameter response from us and clean it (can be only numbers leters and _)
	$p = mysql_escape_string(preg_replace('/[^A-Za-z0-9_]+/','',$_GET['p_resp']));
	if(DEBUG == true) {	error_log(date('[Y-m-d H:i] '). "[Parameter] Postback parameter: $p" . PHP_EOL, 3, LOG_FILE); }
	//Note: we send the parameter $_GET['p_resp'] back ONLY! if user $p has voted for you
	//here run your code
	//first you should check if account $p is valid and exists in your database
	//also check if the user has voted in the last 12 hours
	//give points to user $p
	//close database
	if(DEBUG == true) {	error_log(date('[Y-m-d H:i] '). "[Invalid] Invalid request from IP: $ip_request" . PHP_EOL, 3, LOG_FILE); }
	//handle invalid request when callback is NOT from TopG.
	//ignore or log the $ip_request as invalid request in your database


Check user IP voting records directly on our database

Just query this page to use it:

The page will return 1 if the user has voted in the last 12 hours and 0 if he did not.
In case of any error like missing parameter or invalid values the page will return blank.
Best practice is to define a delaied time to check for the user IP, 10 minutes after user has voted. To do that you will need to create a function that runs every 10 minutes and checks ONLY the users that voted 10 minutes or more ago.
Probably a good solution for delay check is to Create a Cron Job or Windows Task Scheduler depending on your OS.
Our example is simply just for the call + result but we can help with more if needed. Just contact us.

IP Check PHP example

$userip = $_SERVER['REMOTE_ADDR']; //get your player or user IP address
define(TOPG_CHECK,"".$userip); //replace SITEID with your site's ID on TopG then do the next check
$voted = @file_get_contents(TOPG_CHECK); //check url to see response for UserIP
	echo 'Valid! User with IP '.$userip.' has voted!';


Minecraft Votifier

For Minecraft we have a special plugin called votifier. You can enable and set this plugin from Dashboard while you add or edit your server. We will update the Dashboard witha Votifier Testing tool soon.