" ; $input_failure = true; } if (!$form_postalcode) { echo "The postal code is not valid.
"; $input_failure = true; } if (!$form_email) { echo "The email is not valid.
"; $input_failure = true; } if (strcmp($form_password, $form_confirmpassword) !== 0) { echo "Password do not match.
"; $input_failure = true; } if (!empty($form_name) && !empty($form_firstname) && !empty($form_numstreet) && !empty($form_street) && !empty($form_postalcode) && !empty($form_city) && !empty($form_email) && !empty($form_password) && !$input_failure) { if (!chk_account($form_email)) { global $connection; $hashed_password = password_hash($form_password, PASSWORD_DEFAULT); $sql_pquery = "insert into CLIENTS (NomCl, PrenomCl, EmailCl, PasswordCl, NumRueCl, NomRueCl, CodePosteCl, VilleCl) values (?, ?, ?, ?, ?, ?, ?, ?)"; $connection->prepare_query($sql_pquery); $connection->prepared_query_bind_param("ssssisis", array($form_name, $form_firstname, $form_email, $hashed_password, $form_numstreet, $form_street, $form_postalcode, $form_city)); $connection->run_prepared_query(); $connection->close_prepared_query(); echo "You've successfully registered, you will be redirected to the login form in 3 seconds.
"; redirect("index.php?page=login", 3); } else { echo "You're already registered, you will be redirected to the login form in 3 seconds.
"; redirect("index.php?page=login", 3); } } else { echo "There's a required non filled field or the input in a field do not match the required pattern.
"; echo "Retour"; } ?>