Advertisement
smiba

Dogecoin faucet script v1.1.1

Mar 5th, 2014
4,196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.15 KB | None | 0 0
  1. DOGE in faucet:
  2. <?php
  3. //Made by smiba - Feel free to ask support on reddit from me... But no promises, please use google since that is your best friend!
  4. //Make your SQL database like this: http://screenshots.bartstuff.eu/1387003406-Z14wbpSuaCIvNP9VvV2R.png
  5. $version = "1.1.1";
  6. require_once 'jsonRPCClient.php'; //Get this from http://jsonrpcphp.org/?page=download&lang=en - the light is good enough
  7. require_once 'recaptchalib.php'; //Get this from ReCapcha's website
  8. $publickey = ""; //ReCAPCHA Public key here
  9. $privatekey = ""; //ReCAPCHA Private key here
  10. $doge = new jsonRPCClient('http://dogecoinrpc:RPCKEY@127.0.0.1:22555/');
  11. print_r($doge->getbalance(""));
  12. echo "</b> - Please donate:".$doge->getaccountaddress("")."<br /><font size='2'>Set text here or something</font><br />";
  13.  
  14. $username = $_POST['address'];
  15. $ip = $_SERVER['REMOTE_ADDR'];
  16. if(!empty($_POST['address'])) {
  17.     if($doge->getbalance("") < 10){
  18.         echo "Dry faucet, please donate";
  19.     }else{
  20.         $check = $doge->validateaddress($username); //Make sure the text enterend is a doge address
  21.         if($check["isvalid"] == 1){
  22.                 $resp = recaptcha_check_answer($privatekey, $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
  23.         if ($resp->is_valid) {
  24.                             mysql_connect("127.0.0.1", "USERNAME", "PASSWORD")or die("cannot connect to server - Sorry");
  25.                             mysql_select_db("dogecoin")or die("cannot select DB");
  26.                             $time=time();
  27.                             $time_check=$time-43200; //Users can re-get doge every 8 hours (43200 seconds)
  28.                             $sql4="DELETE FROM users WHERE time<$time_check";
  29.                             $result4=mysql_query($sql4);
  30.                             $sql=sprintf("SELECT * FROM users WHERE address='%s' OR ip='$ip'",
  31.                             mysql_real_escape_string($username));
  32.                             $result=mysql_query($sql);
  33.                         $count=mysql_num_rows($result);
  34.                             if($count=="0"){
  35.                                     $amount = rand(1,5);
  36.                                     $sql1=sprintf("INSERT INTO users(address, time, ip,amount)VALUES('%s', '$time', '$ip', '$amount')",
  37.                                     mysql_real_escape_string($username));
  38.                                     $result1=mysql_query($sql1);
  39.                                     $doge->sendfrom("", $username, $amount);
  40.                                     echo "You've got ";
  41.                                     echo $amount;
  42.                                     echo " DOGE!";
  43.                             }else{
  44.                                     echo "Much request, plz wait. You can get new DOGE every 12 hours!";
  45.                             }
  46.             }else{
  47.                 echo "reCAPTCHA invalid!";
  48.             }
  49.  
  50.         }
  51.     }
  52. }
  53. echo '<br /><form Name = "getcoin" Method = "POST" ACTION = "doge2.php"><INPUT TYPE = "text" VALUE = "" NAME = "address" /><INPUT TYPE = "submit" Name = "submit" VALUE = "Send" />';
  54. echo recaptcha_get_html($publickey); ?>
  55. </form>
  56. <br/>
  57.  
  58. </table><p><font size="2">faucet base coded by smiba from doges.org - version <?php echo $version; //Do not remove the base coded by ?></font></p>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement