This repository has been archived by the owner on Feb 25, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
index.php
54 lines (52 loc) · 2.4 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
// Made by Tadeo Kondrak (tadeokondrak.com)
// LICENSE: http://tadeo.mit-license.org/
?>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> //bootstrap 3.1.1
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> //bootstrap 3.1.1
<style>body{margin: 30px;}</style>
<h1>AltCoin (ALT) Faucet</h1>
<hr />
<?php
require_once("ayah.php"); // Install areyouahuman.com into this folder.
require_once("jsonRPCClient.php"); //get this here: http://jsonrpcphp.org/
$alt = new jsonRPCClient('http://username:password@localhost:port/'); //set to altcoind user/pass/port
$min = 1; //set to minimum payout
$max = 5; //set to max payout
$ayah = new AYAH();
if (array_key_exists('submit', $_POST)){
$score = $ayah->scoreResult();
if ($score){
$username = $_POST['address'];
if(!empty($_POST['address'])) {
if($alt->getbalance() < 1){
echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> <a href="#" class="alert-link"></a>Not enough balance.</div>';
} else {
$check = $alt->validateaddress($username);
if($check["isvalid"] == 1){
$amount = rand($min,$max);$alt->sendtoaddress($username, $amount);
echo '<div class="alert alert-dismissable alert-success"><button type="button" class="close" data-dismiss="alert">×</button><strong></strong> <a href="#" class="alert-link"></a>You got ';
echo $amount;
echo " ALT!</div>";
}
}
}
}
else
{
echo '<div class="alert alert-dismissable alert-danger"><button type="button" class="close" data-dismiss="alert">×</button><strong>Error:</strong> <a href="#" class="alert-link"></a>Human Verification Failed.</div>';
}
}
?>
<form role="form" action="index.php" method="POST">
<div class="form-group">
<label for="address">ALT address</label>
<input type="address" name="address" class="form-control" id="address" placeholder="MVVXiPfpBhGoLcWstgQWjrzHWSXX3CM7RR">
</div>
<?php
echo $ayah->getPublisherHTML();
?>
<button type="submit" class="btn btn-default" name="submit">Submit</button>
</form>
<br>
<h5>1-5 ALT payout. | Faucet Balance: <?php print_r($alt->getbalance()); ?> | Donate to the faucet: [address] | Made by: <a href="http://tadeokondrak.com">Tadeo Kondrak</a></h5> | <a href="http://github.com/tadeokondrak/altcoin-faucet">Github Repository</a>