Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <b>DOGE in faucet:
- <?php
- //Made by smiba from doges.org - DO NOT REMOVE THIS MADE BY LINE AND NEITHER THE LAST LINE - http://bartstuff.eu/doge/
- //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
- //You can get jsonRPCClient.php from: http://jsonrpcphp.org/?page=download&lang=en
- //Make your SQL database like this: http://screenshots.bartstuff.eu/1387003406-Z14wbpSuaCIvNP9VvV2R.png
- require_once 'jsonRPCClient.php';
- $doge = new jsonRPCClient('http://RPCUSERNAME:RPCPASSWORD@RPCHOST:RPCPORT/');
- print_r($doge->getbalance());
- echo "</b> - Please donate: DCp9uf6AaZTf4SSTmKmAhJPv5QnoEZh6S5<br />";
- $username = $_POST['address'];
- $ip = $_SERVER['REMOTE_ADDR'];
- if(!empty($_POST['address'])) {
- if($doge->getbalance() < 200){
- echo "Dry faucet, please donate"; //Less then 200 DOGE in the faucet? Close
- }else{
- $check = $doge->validateaddress($username);
- if($check["isvalid"] == 1){
- mysql_connect("SQLHOST", "SQLUSER", "SQLPASS")or die("cannot connect to server - Sorry");
- mysql_select_db("SQLDB")or die("cannot select DB");
- $time=time();
- $time_check=$time-14400; //Allow to get new doge every 14400 seconds (4 hours)
- $sql4="DELETE FROM users WHERE time<$time_check";
- $result4=mysql_query($sql4);
- $sql=sprintf("SELECT * FROM users WHERE address='%s' OR ip='$ip'",
- mysql_real_escape_string($username));
- $result=mysql_query($sql);
- $count=mysql_num_rows($result);
- if($count=="0"){
- $sql1=sprintf("INSERT INTO users(address, time, ip)VALUES('%s', '$time', '$ip')",
- mysql_real_escape_string($username));
- $result1=mysql_query($sql1);
- $amount = rand(20,200); //Give between 20 and 200 DOGE
- $doge->sendtoaddress($username, $amount);
- echo "You've got ";
- echo $amount;
- echo " DOGE!";
- }else{
- echo "Much request, plz wait. You can get new DOGE every 4 hours!";
- }
- }
- }
- }
- ?>
- <br />
- <Form Name ="form1" Method ="POST" ACTION = "doge2.php">
- <INPUT TYPE = "Text" VALUE ="" NAME = "address">
- <INPUT TYPE = "Submit" Name = "Submit" VALUE = "Send">
- </FORM>
- <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