if($balance >= $cashout){
$mysqli->query("UPDATE balances SET balance=balance-$balance WHERE email='$email'");
$balanceQ = $mysqli->query("SELECT balance FROM balances WHERE email='$email'"); //we check again to prevent race attacks
if($balanceQ->fetch_row() >= 0){
$url = "https://inputs.io/api?key=$apiKey&action=send&address=&amount=¬e=&pin=$apiPin" . urlencode($cashoutMessage . " | MyFaucet Powered") . "&address=" . urlencode($email) . "&amount=" . ($balance / 100000000);
$response = file_get_contents($url);
if($response[0] == "["){
//success
echo "<div class='alert alert-success'>Successful cashout to $email - enjoy!</div>";
} else {
echo "<div class='alert alert-error'>An error has occured - $response</div>";
if($response == "NO_BALANCE"){
echo "<div class='alert alert-error'>The site does not have enough coins to pay out!</div>";
$mysqli->query("UPDATE balances SET balance=balance+$balance WHERE email='$email'");
Im having problems when people go cashout and they get error page i think the problem is $url but i dont know if you want to find out the api go here https://inputs.io/api and head to send transactions so from there i dont know what else to do.