Proposed Callback For Virool


SUBMITTED BY: Guest

DATE: Sept. 17, 2013, 7:06 p.m.

FORMAT: Text only

SIZE: 1.3 kB

HITS: 1267

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

comments powered by Disqus