Ejemplo n.º 1
0
 public function insertUser()
 {
     $this->password = hashPasswords($this->password, $this->username);
     $sql = "INSERT INTO users (firstname, lastname,username,password) \n\t\tVALUES('{$this->first_name}','{$this->last_name}','{$this->username}','{$this->password}')";
     try {
         $this->db->exec($sql);
         echo "Registration Complete!";
     } catch (Exception $e) {
         echo "Failed to register";
     }
 }
Ejemplo n.º 2
0
 public function __construct($password, $username, $db)
 {
     //echo "password: "******"<br>";
     //echo "username: "******"<br>";
     $this->username = cleanString($username);
     $password = cleanString($password);
     $this->password = hashPasswords($password, $this->username);
     //echo $this->password. "<br>";
     $this->db = $db;
     $this->sqlSelect();
 }