Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Software Development
Programming
Programming Q&A
Help me function issues
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Li1M0ST3Rz" data-source="post: 438459" data-attributes="member: 1271"><p>so ive coded a script to insert into database in a function way and it accidentally inserted 4x with one click.</p><p></p><p>Script: </p><p>[PHP]$user = new User($this->con);</p><p> $block_io = new BlockIo($this->apiKey, $this->version);</p><p> if(!empty($_POST['deposit']))</p><p> {</p><p> $deposit = floatval(ltrim($_POST['deposit'], '$'));</p><p> if($deposit >= $this->core("deposit_limit"))</p><p> {</p><p> $temp = $this->randomStrings() . '-' . $user->row("username");</p><p> $sql = "UPDATE `accounts` SET `temp_address`='".$temp."' WHERE `username`='".$user->row("username")."'";</p><p> $upd = $this->con->query($sql);</p><p> if(!$sql)</p><p> {</p><p> $this->messages[] = array('loadup' => '<div class="alert alert-warning">Error contact site coder!</div>');</p><p> }</p><p> else</p><p> {</p><p> $newAddress = $block_io->get_new_address(array('label' => $temp));</p><p> $execute = $newAddress->data->address;</p><p> $txid = sha1($execute);</p><p> $time = date("m.d.y");</p><p> $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."','')");</p><p> </p><p> $this->messages[] = array('loadup' => '<div class="alert alert-success" role="alert">Successfully generated bitcoin address!</div>');</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $this->messages [] = array('payment' => '<div class="alert alert-warning" role="alert">You enter a low deposit amount please fill in</div>');</p><p> }</p><p> }</p><p> else</p><p> {</p><p> $this->messages[] = array('payment' => '<div class="alert alert-warning" role="alert">Error the deposit input is empty!</div>');</p><p> }[/PHP]</p></blockquote><p></p>
[QUOTE="Li1M0ST3Rz, post: 438459, member: 1271"] so ive coded a script to insert into database in a function way and it accidentally inserted 4x with one click. 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>'); }[/PHP] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Software Development
Programming
Programming Q&A
Help me function issues
Top