Modify a PHP login script by adding PHP PDO

  • Status Closed
  • Budget N/A
  • Total Bids 6

Project Description

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 to the script that has following modification:

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_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


$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);



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

Get free quotes for a project like this
Skills Required

Looking to make some money?

  • Set your budget and the timeframe
  • Outline your proposal
  • Get paid for your work

Hire Freelancers who also bid on this project

    • Forbes
    • The New York Times
    • Time
    • Wall Street Journal
    • Times Online