Bitcoin Forum
July 04, 2024, 02:12:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: [WTB]Secure code(sql injection)  (Read 488 times)
validium (OP)
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

Decentralized thinking


View Profile
December 14, 2014, 01:04:07 PM
Last edit: December 15, 2014, 05:21:49 AM by validium
 #1

Code:
<?php
    $con 
mysql_connect("localhost","db user","password");
    if (!
$con)
      {
      die(
'Could not connect: ' mysql_error());
      }

    
mysql_select_db("db_name"$con);

    
$sql="INSERT INTO `db_name`.`form` (`bitcoinaddress`, `amountinbtc`, `phonenumber`) VALUES
    ('
$_POST[bitcoinaddress]','$_POST[amountinbtc]','$_POST[phonenumber]')";

    if (!
mysql_query($sql,$con))
      {
      die(
'Error: ' mysql_error());
      }

echo (
$_POST['amountinbtc']);

mysql_close($con);
?>


I need someone who can modify this to stop sql injection.

I also need the data to be saved in sessions so that when the user refreshes the page the same data wont be duplicated in the database.

Willing to pay 15$(negotiable) in btc for this as long as it works as needed.

Parazyd
Hero Member
*****
Offline Offline

Activity: 812
Merit: 587


Space Lord


View Profile WWW
December 14, 2014, 08:06:22 PM
 #2

There's something in your database that always returns True. You should fix that.
validium (OP)
Sr. Member
****
Offline Offline

Activity: 350
Merit: 250

Decentralized thinking


View Profile
December 15, 2014, 05:23:01 AM
 #3

There's something in your database that always returns True. You should fix that.

Fixed. Am still looking for someone to do this.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!