Li1M0ST3Rz
I <3 Bianca
- Sep 13, 2010
- 269
- 166
so ive coded a script to insert into database in a function way and it accidentally inserted 4x with one click.
Script:
Script:
PHP:
$user = new User($this->con);
$block_io = new BlockIo($this->apiKey, $this->version);
if(!empty($_POST['deposit']))
{
$deposit = floatval(ltrim($_POST['deposit'], '$'));
if($deposit >= $this->core("deposit_limit"))
{
$temp = $this->randomStrings() . '-' . $user->row("username");
$sql = "UPDATE `accounts` SET `temp_address`='".$temp."' WHERE `username`='".$user->row("username")."'";
$upd = $this->con->query($sql);
if(!$sql)
{
$this->messages[] = array('loadup' => '<div class="alert alert-warning">Error contact site coder!</div>');
}
else
{
$newAddress = $block_io->get_new_address(array('label' => $temp));
$execute = $newAddress->data->address;
$txid = sha1($execute);
$time = date("m.d.y");
$this->con->query("INSERT INTO `btc_history`(`id`, `txid`,`label`,`btc_address`, `usd`, `username`, `date`, `status`) VALUES ('','".$txid."','".$temp."','".$execute."','".$deposit."','".$user->row("username")."','".$time."','')");
$this->messages[] = array('loadup' => '<div class="alert alert-success" role="alert">Successfully generated bitcoin address!</div>');
}
}
else
{
$this->messages [] = array('payment' => '<div class="alert alert-warning" role="alert">You enter a low deposit amount please fill in</div>');
}
}
else
{
$this->messages[] = array('payment' => '<div class="alert alert-warning" role="alert">Error the deposit input is empty!</div>');
}