<?php
$email = $_GET['var1'];
$reward = $_GET['var2'];
// where var1 and var2 are parametes you enter in the virool settings for email, and reward
fa
//replace with your credentials
$sqlHost = "localhost"; //Unless your MySQL server is on another server, leave it at 127.0.0.1
$sqlUser = "sqlusername"; //Your MySQL username with permissions to modify the new database you created
$sqlPassword = "sqlpassword"; //Your MySQL password
$sqlDatabase = "databasename"; //The MySQL database you created and imported
$mysqli = new mysqli($sqlHost, $sqlUser, $sqlPassword, $sqlDatabase);
if($mysqli->connect_errno){
echo "SQL error: " . $mysqli->connect_error;
exit;
}
//query to update balances
$mysqli->query("UPDATE balances SET balance=balance+$reward,totalbalance=totalbalance+$reward WHERE email='$email'");
//query to update dispenses, I log the virool IP so that any fraud/hack can be detected. for which I have implemented another page.
//this is where you can implement another table for use in faucet.php popup
$viroolIP = $_SERVER['REMOTE_ADDR'];
$viroolC = "virool";
$mysqli->query("INSERT INTO dispenses(amount, dispensed, email, ip, useragent) VALUES('$reward', NOW(), '$email', '$viroolIP', '$viroolC')");
?>