Advertisement
smiba

Dogecoin faucet

Dec 13th, 2013
302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.37 KB | None | 0 0
  1. <b>DOGE in faucet:
  2. <?php
  3. //Script made by Smiba from doges.org - http://bartstuff.eu/doge/
  4. //DO NOT REMOVE MADE BY! I'm trying to help here, so just leaving 1 line would be the minimum you could do for me
  5.  require_once 'jsonRPCClient.php';
  6.  $doge = new jsonRPCClient('http://dogecoinrpc:PASSWORD@127.0.0.1:22555/');
  7.  print_r($doge->getbalance());
  8. echo "</b> - Please donate: DCp9uf6AaZTf4SSTmKmAhJPv5QnoEZh6S5<br />";
  9.  
  10. $username = $_POST['address'];
  11. $ip = $_SERVER['REMOTE_ADDR'];
  12. if(!empty($_POST['address'])) {
  13.         if($doge->getbalance() < 20){
  14.                 echo "Dry faucet, please donate";
  15.         }else{
  16.                 $check = $doge->validateaddress($username);
  17.                 if($check["isvalid"] == 1){
  18.                         mysql_connect("127.0.0.1", "SQLUSER", "SQLPW")or die("cannot connect to server - Sorry");
  19.                         mysql_select_db("SQLDB")or die("cannot select DB");
  20.                         $time=time();
  21.                         $time_check=$time-14400; //SET TIME 4 HOUR
  22.                         $sql4="DELETE FROM users WHERE time<$time_check";
  23.                         $result4=mysql_query($sql4);
  24.                         $sql=sprintf("SELECT * FROM users WHERE address='%s' OR ip='$ip'",
  25.                         mysql_real_escape_string($username));
  26.                         $result=mysql_query($sql);
  27.                         $count=mysql_num_rows($result);
  28.                         if($count=="0"){
  29.                                 $sql1=sprintf("INSERT INTO users(address, time, ip)VALUES('%s', '$time', '$ip')",
  30.                                 mysql_real_escape_string($username));
  31.                                 $result1=mysql_query($sql1);
  32.                                 $amount = rand(2,20);
  33.                                 $doge->sendtoaddress($username, $amount);
  34.                                 echo "You've got ";
  35.                                 echo $amount;
  36.                                 echo " DOGE!";
  37.  
  38.                         }else{
  39.                                 echo "Much request, plz wait. You can get new DOGE every 4 hours!";
  40.                         }
  41.                 }
  42.         }
  43. }
  44. ?>
  45. <br />
  46. <Form Name ="form1" Method ="POST" ACTION = "doge2.php">
  47. <INPUT TYPE = "Text" VALUE ="" NAME = "address">
  48. <INPUT TYPE = "Submit" Name = "Submit" VALUE = "Send">
  49. </FORM>
  50. <br/><br/>Script made by Smiba from doges.org
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement