Modify a PHP login script by adding PHP PDO - repost

Closed Posted Mar 20, 2013 Paid on delivery
Closed Paid on delivery

We need help for a small project from PHP expert who can handle PHP POD very well. If it goes well, there will be more projects coming.

We got a PHP login script that works very well but we need to add some security features to make it more secure. We want the script to have following modification and but maintain largely original code:

1. Use PHP PDO to connect mysql database. Please see the example:

try {

$db = new PDO("mysql:host=".DBHOST.";dbname=".DBNAME, DBUSER, DBPASS);

$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);

}catch (Exception $e){

die('Cannot connect to mySQL server.');

}

2. Use PHP PDO to interact with mysql database. See the example:

function create_account(){

//Create new account

$this->hash($this->pass);

$sql = 'INSERT into users (username, password, email) VALUES (:username, :password, :email)';

$statement = $this->db->prepare($sql);

$statement->bindParam(':username', $this->user, PDO::PARAM_STR);

$statement->bindParam(':password', $this->pass, PDO::PARAM_STR);

$statement->bindParam(':email', $this->email, PDO::PARAM_STR);

$statement->execute();

}

3. After modification, the scrip will be working smoothly.

MySQL PHP

Project ID: #4352358

About the project

14 proposals Remote project Active Apr 26, 2013

14 freelancers are bidding on average $40 for this job

infoway

We have 8+ years experience in web development in php, we are ready to work with you, please check my "PMB".

$45 USD in 1 day
(529 Reviews)
9.7
toinnisfree

quick pro help. ftp and milestone required.

$65 USD in 1 day
(770 Reviews)
8.3
samkaranja

As discussed

$35 USD in 1 day
(83 Reviews)
7.3
pentium10

Professional work from professionals!

$50 USD in 1 day
(221 Reviews)
6.9
rsen75

i have over 14 years of web development and designing experience, Kindly check PM

$40 USD in 3 days
(208 Reviews)
7.2
CARLOSHUGGINS

Hi I'm a PHP expert with more than 12 years of experience... I'm a responsable, honest hard working professional.... I'm here to serve you... thanks for considering my proposal.

$35 USD in 3 days
(69 Reviews)
6.3
AdamsK

Ready for service sir, thanks

$40 USD in 1 day
(85 Reviews)
5.8
darkerbg

I'm ready to do it!

$30 USD in 1 day
(21 Reviews)
5.1
onlymaj

Hi .a security expert. ready to start !

$40 USD in 3 days
(10 Reviews)
4.1
shaeed019208789

Hello, I think I can help. Just contact with me. Thanks

$30 USD in 3 days
(7 Reviews)
4.7
ITdepartment

Hi there, web programmer expert ready to start right away. It's a simple project for me, looking forward working with you, regards

$40 USD in 1 day
(3 Reviews)
2.5
gimli2

I can do it for you - 10 years experience with php.

$35 USD in 2 days
(0 Reviews)
0.0
sabhi616

will be completed in a day.

$30 USD in 1 day
(0 Reviews)
0.0