PHP API & documentation

The ServerPact API make it possible to forward the username from your site, to our vote site. In this case, people don't need to fill in the username field. It is also possible to reward your voters with a redirect call to your site, and then do a PHP API check and execute some PHP reward code on your site.

PHP

$vote_gebruikersnaam = $_GET["username"];//Username
$vote_ip = getenv("REMOTE_ADDR");
$vote_url = "http://www.serverpact.com/controle_votes.php"."?username=".$vote_gebruikersnaam."&ip=".$vote_ip;

$result = @implode("",file($vote_url));

if ($result != "ok") 
{
  /* code if vote was INCORRECT */
  echo 'vote NOT ok';
}
else
{
  /* rewardcode if vote was CORRECT */
  echo"vote ok";
}

If you use this code, activate the API and the redirect link on your server edit page.

Forward username to ServerPact

If you want to forward the username to ServerPact, you can do this with this code:

$username = ***your username***;

http://www.serverpact.com/vote-**your ServerPact serverID***&username=$username

Votifier

Do you want to know more about the configuration of Votifier?
Click here for documentation.

Activate Votifier for your server? Click here

A website made with for online servers like Minecraft!
Our terms and conditions | Sitemap
©2012-2024 serverpact.com