X-Git-Url: https://git.piment-noir.org/?p=Project_webapp.git;a=blobdiff_plain;f=includes%2Fformregister.php;h=4abaa5001fd1a712dcef5c3f782199814afc2dee;hp=6cb92236fa569bfa61d91993776b3bec8d8ca33d;hb=1f4879b9c1089889355c57ce1e2dda1d3f032872;hpb=5b8676e8ac4c9e8ae16af30b3e664be1a5bbcb4b
diff --git a/includes/formregister.php b/includes/formregister.php
index 6cb9223..4abaa50 100644
--- a/includes/formregister.php
+++ b/includes/formregister.php
@@ -9,31 +9,28 @@ $form_email = filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL);
$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.
" ;
- $error_numstreet = true;
+ $input_failure = true;
}
if (!$form_postalcode) {
echo "The postal code is not valid.
";
- $error_postalcode = true;
+ $input_failure = true;
}
if (!$form_email) {
echo "The email is not valid.
";
- $error_email = true;
+ $input_failure = true;
}
if (strcmp($form_password, $form_confirmpassword) !== 0) {
echo "Password do not match.
";
- $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);