$formValidation = null; if ($_POST) { $modified = false; Validation::trimForm(array('firstName', 'lastName', 'sex', 'email', 'birthDate', 'address', 'postalCode', 'city', 'phoneNumber'), $_POST); Validation::validateForm(array('firstName' => function ($value) { return !Validation::contains_numeric($value) ? true : 'Un prénom n\'a pas de chiffres ...'; }, 'lastName' => function ($value) { return !Validation::contains_numeric($value) ? true : 'Un nom n\'a pas de chiffres ...'; }, 'city' => function ($value) { return !Validation::contains_numeric($value) ? true : 'Une ville n\'a pas de chiffres ...'; }, 'phoneNumber' => function ($value) { return !empty($value) && Validation::is_valid_phoneNumber($value) || $value == "" || empty($value) ? true : 'Numéro de téléphone non valide'; }, 'email' => function ($value) { return Validation::is_valid_email($value) || $value == "" || empty($value) ? true : 'Mail non valide'; }), $_POST); if (Validation::isFormValid()) { if ($_POST['firstName'] != $user->getFirstName()) { $user->setFirstName($_POST['firstName']); $modified = true; } if ($_POST['lastName'] != $user->getLastName()) { $user->setLastName($_POST['lastName']); $modified = true; } if ($_POST['sex'] != $user->getSex()) { $user->setSex($_POST['sex']); $modified = true; } if ($_POST['email'] != $user->getEmail()) { $user->setEmail($_POST['email']); $modified = true;
-moz-border-radius: 4px; border-radius: 4px; } </style> </head> <body> <div id="wrapper"> <header> <h1><a href="<?php echo $_SERVER['PHP_SELF']; ?> ">~ Installation ~</a></h1> </header> <div id="content"> <?php if (!isset($_POST['install']) || !Validation::isFormValid()) { ?> <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> "> <dl> <dt> <label for="dbURI">Host URI</label> </dt> <dd> <input id="dbURI" type="text" name="dbURI" value="<?php echo @$_POST['dbURI']; ?> " placeholder="Par défaut `localhost`" autofocus /> </dd>