$form_password = filter_input(INPUT_POST, "password", FILTER_SANITIZE_STRING);
$form_confirmpassword = filter_input(INPUT_POST, "confirmpassword", FILTER_SANITIZE_STRING);
-$error_numstreet = false;
-$error_postalcode = false;
-$error_email = false;
-$error_password = false;
+$input_failure = false;
if (!$form_numstreet) {
echo "The street number is not valid. <br>" ;
- $error_numstreet = true;
+ $input_failure = true;
}
if (!$form_postalcode) {
echo "The postal code is not valid. <br>";
- $error_postalcode = true;
+ $input_failure = true;
}
if (!$form_email) {
echo "The email is not valid. <br>";
- $error_email = true;
+ $input_failure = true;
}
if (strcmp($form_password, $form_confirmpassword) !== 0) {
echo "Password do not match. <br>";
- $error_password = true;
+ $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) &&
- !$error_numstreet && !$error_postalcode && !$error_email && !$error_password) {
+ !$input_failure) {
if (!chk_account($form_email)) {
global $connection;
$hashed_password = password_hash($form_password, PASSWORD_DEFAULT);
echo "There's a required non filled field or the input in a field do not match the required pattern. <br>";
echo "<a href=\"javascript:history.go(-1)\">Retour</a>";
}
+
?>