Advertisement
smiba

Dogecoin faucet v1.0.1

Dec 14th, 2013
1,333
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.76 KB | None | 0 0
  1. <b>DOGE in faucet:
  2. <?php
  3. //Made by smiba from doges.org - DO NOT REMOVE THIS MADE BY LINE AND NEITHER THE LAST LINE - http://bartstuff.eu/doge/
  4. //Version 1.0.1, still some work to be done. Code is a bit dirty and the script can't handle problems with the rpc connection properly
  5. //You can get jsonRPCClient.php from: http://jsonrpcphp.org/?page=download&lang=en
  6. //Make your SQL database like this: http://screenshots.bartstuff.eu/1387003406-Z14wbpSuaCIvNP9VvV2R.png
  7.  require_once 'jsonRPCClient.php';
  8.  $doge = new jsonRPCClient('http://RPCUSERNAME:RPCPASSWORD@RPCHOST:RPCPORT/');
  9.  print_r($doge->getbalance());
  10. echo "</b> - Please donate: DCp9uf6AaZTf4SSTmKmAhJPv5QnoEZh6S5<br />";
  11.  
  12. $username = $_POST['address'];
  13. $ip = $_SERVER['REMOTE_ADDR'];
  14. if(!empty($_POST['address'])) {
  15.         if($doge->getbalance() < 200){
  16.                 echo "Dry faucet, please donate"; //Less then 200 DOGE in the faucet? Close
  17.         }else{
  18.                 $check = $doge->validateaddress($username);
  19.                 if($check["isvalid"] == 1){
  20.                         mysql_connect("SQLHOST", "SQLUSER", "SQLPASS")or die("cannot connect to server - Sorry");
  21.                         mysql_select_db("SQLDB")or die("cannot select DB");
  22.                         $time=time();
  23.                         $time_check=$time-14400; //Allow to get new doge every 14400 seconds (4 hours)
  24.                         $sql4="DELETE FROM users WHERE time<$time_check";
  25.                         $result4=mysql_query($sql4);
  26.                         $sql=sprintf("SELECT * FROM users WHERE address='%s' OR ip='$ip'",
  27.                         mysql_real_escape_string($username));
  28.                         $result=mysql_query($sql);
  29.                         $count=mysql_num_rows($result);
  30.                         if($count=="0"){
  31.                                 $sql1=sprintf("INSERT INTO users(address, time, ip)VALUES('%s', '$time', '$ip')",
  32.                                 mysql_real_escape_string($username));
  33.                                 $result1=mysql_query($sql1);
  34.                                 $amount = rand(20,200); //Give between 20 and 200 DOGE
  35.                                 $doge->sendtoaddress($username, $amount);
  36.                                 echo "You've got ";
  37.                                 echo $amount;
  38.                                 echo " DOGE!";
  39.  
  40.                         }else{
  41.                                 echo "Much request, plz wait. You can get new DOGE every 4 hours!";
  42.                         }
  43.                 }
  44.         }
  45. }
  46. ?>
  47. <br />
  48. <Form Name ="form1" Method ="POST" ACTION = "doge2.php">
  49. <INPUT TYPE = "Text" VALUE ="" NAME = "address">
  50. <INPUT TYPE = "Submit" Name = "Submit" VALUE = "Send">
  51. </FORM>
  52. <br/><br/><p><font size="2">Script made by smiba from doges.org</font></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement