2016-03-23 17 views
0

Ich habe versucht, mir selbst diesen Code zu implementieren, um die automatische Bitcoin-Zahlungen zu Wasserhahn Box zu implementieren, aber einige Fehler gibt es brauche ich mit Hilfe. und es mir diesen FehlerZahlungen an die Wasserhahnbox senden

The bitcoinrotator.publiadds.org.pt page is not working bitcoinrotator.publiadds.org.pt can not process this request for time. 500 

<?php 
 
//custom parameters 
 
$api_key = "my_api_key"; 
 
$userAddy = $_SESSION['user']; 
 
require_once("faucetbox.php"); 
 
$currency = "BTC"; # or LTC or any other supported by FaucetBOX 
 
$faucetbox = new FaucetBOX($api_key, $currency); 
 
$users = array(
 
    'user_id' => clean($user_id), 
 
    'user_name' => clean($user_name), 
 
    'user_email' => clean($user_email), 
 
    'user_pass' => clean($user_pass), 
 
    'user_points' => clean($user_points), 
 
    'user_wallet' => clean($user_wallet) 
 
); 
 
session_start(); 
 
include_once 'dbconnect.php'; 
 

 
if(!isset($_SESSION['user'])) 
 
{ 
 
\t header("Location: index.php"); 
 
} 
 

 
$selfNav = mysqli_query($conn, "SELECT user_wallet, user_points FROM users WHERE user_id=".$_SESSION['user']); 
 
$rowNav = mysqli_num_rows($selfNav); 
 

 
$rowAssoc = mysqli_fetch_assoc($selfNav); 
 

 
$balance = $rowAssoc['user_points']; 
 
$wallet = $rowAssoc['user_wallet']; 
 

 
//auto cashout if bal over 0.00010000 
 
\t 
 
if($balance > 0.00010000){ 
 
\t  
 
$amount = $rowAssoc['user_points']; 
 
\t  \t 
 
$currency = "BTC"; 
 
\t \t 
 
$faucetbox = new Faucetbox($api_key, $currency); 
 
\t \t 
 
$result = $faucetbox->send($wallet, $amount); 
 
\t \t 
 
if($result["success"] === true){ 
 
\t \t 
 
$_SESSION['cashout'] = $result["html"]; 
 
\t \t 
 
//reset balance to zero 
 
\t \t 
 
mysqli_query($conn, "UPDATE `users` SET user_points = 0 WHERE user_id = " . $_SESSION['user')]; 
 
\t \t \t \t 
 
header('Location: ../home.php'); 
 
?>

+0

Könnten Sie bitte Ihre Frage bearbeiten und die Fehlermeldung, die Sie bekommen, eingeben? – CydrickT

Antwort

0

auch dort geben sie ihre Arbeit, aber es mit einigen Bug dort bleiben, aber jetzt seine Arbeit der Fehler Array ([user_wallet] => 111111111111111111111111111111111111 [user_points] => 0,00000010) Fehler en Balance

<?php 
 
session_start();//Session start is ALWAYS the first thing to do. 
 
if(!isset($_SESSION['user'])) 
 
{ 
 
\t header("Location: index.php"); //Sending headers its the next thing to do. Always. 
 
} 
 
include_once 'dbconnect.php'; 
 

 

 
//custom parameters 
 
$api_key = "my_api_key"; 
 
$userAddy = $_SESSION['user']; 
 
require_once("faucetbox.php"); 
 
$currency = "BTC"; # or LTC or any other supported by FaucetBOX 
 
$faucetbox = new FaucetBOX($api_key, $currency); 
 
//$users = array(
 
//  'user_id' => clean($user_id), 
 
//  'user_name' => clean($user_name), 
 
//  'user_email' => clean($user_email), 
 
//  'user_pass' => clean($user_pass), 
 
//  'user_points' => clean($user_points), 
 
//  'user_wallet' => clean($user_wallet) 
 
//); 
 

 

 

 
//You are mixing mysql and mysqli, you need to choose one. Since you are on a shared hosting, mysqli is probably 
 
//not installed/available, so we will keep using mysql. mysqli is safer! 
 
$selfNav = mysql_query("SELECT user_wallet, user_points FROM users WHERE user_id=".$_SESSION['user']); 
 
$rowNav = mysql_num_rows($selfNav); 
 

 
$rowAssoc = mysql_fetch_assoc($selfNav); 
 

 
print_r($rowAssoc); 
 

 
$balance = $rowAssoc['user_points']; 
 
$wallet = $rowAssoc['user_wallet']; 
 

 
//auto cashout if bal over 0.00010000 
 
\t 
 
if($balance > 0.00010000){ 
 
\t  
 
$amount = $rowAssoc['user_points']; 
 
\t  \t 
 
$currency = "BTC"; 
 

 
\t \t 
 
$result = $faucetbox->send($wallet,$amount); //$amount); 
 
\t \t 
 
if($result["success"] === true){ 
 
\t \t 
 
$_SESSION['cashout'] = $result["html"]; 
 
\t \t 
 
//reset balance to zero 
 
\t \t 
 
mysql_query("UPDATE `users` SET user_points = 0 WHERE user_id = " . $_SESSION['user']); 
 
\t \t \t \t echo "result sucess and location go"; 
 
//header('Location: ../home.php'); 
 
}else{ 
 
\t echo "Error on faucet"; 
 
\t var_dump($result); 
 
\t //What happens if there is an error? 
 
} 
 
}else{ 
 
\t echo "do not have enough credit to cash out"; 
 
\t //what happens if they dont have enough balance? 
 
} 
 
?>