The pingback system is to make sure a user has been voted.
The user votes at
http://l2topzone.com/vote.php?id=ID&user=USER (example) and once the l2topzone server processed the vote calls our server
http://ourserver.com/postback.php?=USER (example) and we need to check that vote and give the reward. The postback url should be something to add in our server profile at
http://l2topzone.com/myhome.html.
An example for us could be:
<?php
// A simple example postback script
$authorized = "127.0.0.1"; // L2TopZone IP (is not the real one)
if($_SERVER['REMOTE_ADDR'] != $authorized) {
// Incorrect IP
exit;
}
// This variable is what you send to our server (postback?=USER)
$user = mysql_real_escape_string($_POST['postback']);
$link = mysqli_connect("localhost", "user", "password", "db")
or die("Connect error: " . mysqli_error($link));;
// Give the reward to the user
mysqli_query("UPDATE rewards SET reward = reward + 100 WHERE userid = $user")
or die("Query error: " . mysqli_error($link));
mysqli_close($link);
?>
Another thing is the ip check. Our server calls an url like
http://l2topzone.com/check.php?id=ID&ip=IP (example) and could show TRUE or FALSE if that IP voted today.
If I could decide what implement first, I would like to have the ip check first. That way I could know if an IP voted or not.
I hope you like this and implement it on l2topzone soon.
Best regards.
Linkback: https://l2topzone.com/forum/index.php?topic=19094.0