'; $error = true; } if(strlen($passwort) == 0) { echo 'Please enter password
'; $error = true; } if($passwort != $passwort_confirm) { echo 'passwords doesnt match
'; $error = true; } if(!$error) { $statement = $pdo->prepare("SELECT * FROM users WHERE email = :email"); $result = $statement->execute(array('email' => $email)); $user = $statement->fetch(); if($user !== false) { echo 'already a user here
'; $error = true; } } if(!$error) { $passwort_hash = password_hash($passwort, PASSWORD_DEFAULT); $statement = $pdo->prepare("INSERT INTO users (email, passwort) VALUES (:email, :passwort)"); $result = $statement->execute(array('email' => $email, 'passwort' => $passwort_hash)); if($result) { echo 'successfull registered. Login'; $showFormular = false; } else { echo 'Error. Please try again!
'; } } } if($showFormular) { ?>
E-Mail:


Password:

Password (aganin):