Reward Players, How to setup a return
Back to AccountStep 1.) Add a user id to the end of your vote link like so
http://bbogd.com/vote/game-name/USERID
Step 2.) Create a script on your server that we can send USERID back to
Step 3.) Modify game listing & update the "Return" to point to your reward script.
IMPORTANT! WARNING!
Like in the example script below, make sure each player is only rewarded once!
Got a question or need help? Contact us!
Example Reward Script
<?php
// Example Top Site Reward Script by Bbogd.com - Dec 6th, 2015
// Contact us if you have an issue with this script
// Connect to database
$db = new mysqli('localhost', 'username', 'password', 'database');
// Grab User ID
$userid = is_int($_GET['userid']) ? $_GET['userid'] : false;
// Reward Player only if they haven't today.
if($userid){
// Reward if player hasn't voted
$user = $db->query("SELECT voted FROM users WHERE id='$userid'")->fetch_assoc();
if(!$user['voted']){
$db->query("UPDATE users SET reward=reward+1, voted='1' WHERE id='$userid';");
}
}