Dit is mijn code tot nu toe:
PHP
public function register() {
$correct = false;
try {
$con = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );
$con->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
$sql = "INSERT INTO users(username, password) VALUES(:username, :password)";
$stmt = $con->prepare( $sql );
$stmt->bindValue( "username", $this->username, PDO: : PARAM_STR );
$stmt->bindValue( "password", hash("sha256", $this->password . $this->salt), PDO: : PARAM_STR );
$stmt->execute();
return "Registration Successful <br/> <a href='index.php'>Login Now</a>";
}catch( PDOException $e ) {
return $e->getMessage();
}
}
Toon Meer
Ik hoop dat iemand mij kan helpen, ik zit nu helemaal vast, heb al een hele hoop dingen geprobeerd