Advertisement
Guest User

Untitled

a guest
Mar 4th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.90 KB | None | 0 0
  1. <head> <script src='https://www.google.com/recaptcha/api.js'></script>
  2. </head> <body> <?php
  3. //----[Settings]
  4. $version = "1.3.2";
  5. $coinname = "";
  6.  
  7. $rpcusername = "";
  8. $rpcpassword = "";
  9. $rpcIP = "127.0.0.1";
  10. $rpcport = "";
  11. $sqlIP = "127.0.0.1";
  12. $sqluser = "root";
  13. $sqlpassword = "";
  14. $sqlDB = "faucet";
  15. $minbalance = 0.005; //Never make this lower then the $randomHigh,
  16. it could result in errors on payout.
  17.  
  18. $randomlow = 5;
  19. $randomhigh = 50;
  20. $randomdivide = 10000; //To create numbers lower then 1.0
  21. $walletaccount = "faucet"; //Keep empty to just use the main wallet
  22.  
  23. $capatchaSecret = ""; //Your Recapatcha V2 secret
  24. $capatchaSiteKey = ""; //Your Recapatcha V2 site key
  25. $dev = false; //Set to TRUE to enable error reporting (Useful for
  26. development!)
  27. //-----
  28. //----[Debug]
  29. if($dev==true){
  30. error_reporting(E_ALL); //show errors
  31. ini_set('display_startup_errors',1); //show errors
  32. ini_set('display_errors',1); //show errors
  33. error_reporting(-1); //show errors
  34. }
  35. //----
  36. //----[Dependencies]
  37. require_once 'jsonRPCClient.php';
  38. //----
  39. $faucet = new
  40. jsonRPCClient("http://$rpcusername:$rpcpassword@$rpcIP:$rpcport/");
  41. print_r($faucet->getbalance("$walletaccount"));
  42. echo "</b> - Donate to the faucet:
  43. ".$faucet->getaccountaddress("$walletaccount")."<br />";
  44. if(!empty($_POST['address'])) {
  45. $username = $_POST['address'];
  46. $ip = $_SERVER['REMOTE_ADDR'];
  47.  
  48. if($faucet->getbalance("$walletaccount") < $minbalance){
  49. echo "Not enough funds.";
  50. }else{
  51. $check = $faucet->validateaddress($username); //Make sure
  52. the text entered is a valid address
  53. if($check["isvalid"] == 1){
  54. $RecapatchaJson =
  55. json_decode(file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$capatchaSecret&response=".$_POST['g-recaptcha-response']."&remoteip=".$_SERVER['REMOTE_ADDR']));
  56. if ($RecapatchaJson->success == true){
  57. $link = mysqli_connect($sqlIP,
  58. $sqluser, $sqlpassword)or die("cannot connect to server - Sorry");
  59. mysqli_select_db($link,
  60. $sqlDB)or die("cannot select DB");
  61. $time = time();
  62. $time_check = $time-43200;
  63. //Users can re-get coins every 8 hours (43200 seconds)
  64. $sql4 = "DELETE FROM users WHERE
  65. time<$time_check";
  66. $result4 = mysqli_query($link,
  67. $sql4);
  68. $sql = "SELECT * FROM users
  69. WHERE address='$username' OR ip='$ip'";
  70. $result = mysqli_query($link,
  71. $sql);
  72. $count =
  73. mysqli_num_rows($result);
  74. if($count == "0"){
  75. $amount =
  76. mt_rand($randomlow,$randomhigh) / $randomdivide;
  77. $sql1 = sprintf("INSERT
  78. INTO users(address, time, ip, amount) VALUES ('$username', '$time',
  79. '$ip', '$amount')");
  80. $result1 =
  81. mysqli_query($link, $sql1);
  82. $faucet->sendfrom("$walletaccount",
  83. $username, $amount);
  84. echo "You've got $amount
  85. $coinname to your account at $username";
  86. }else{
  87. echo "Too many requests,
  88. you can only get new $coinname every 8 hours! (So sorry!)";
  89. }
  90. }else{
  91. echo "Capatcha Failure";
  92. }
  93. }else{
  94. echo "The address you've entered is
  95. invalid";
  96. }
  97. }
  98. }
  99. $faucetlowcalc = $randomlow / $randomdivide;
  100. $faucethighcalc = $randomhigh / $randomdivide;
  101. echo "<br/>You can currently get between $faucethighcalc and
  102. $faucetlowcalc from this faucet every 8 hours. Good luck!<br/>";
  103. echo '<br />Your '.$coinname.' address: <form Name = "getcoin"
  104. Method = "POST" ACTION = ""><INPUT TYPE = "text" VALUE = "" NAME =
  105. "address" /><INPUT TYPE = "submit" Name = "submit" VALUE = "Roll!"
  106. /><br/><br/><div class="g-recaptcha"
  107. data-sitekey="'.$capatchaSiteKey.'"></div>';
  108. ?> </form> </table><p><font size="2">Simple faucet base coded by
  109. Smiba - version <?php echo $version; //Do not remove the base coded by
  110. ?></font></p> </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement