<input class=btchoix type="submit" name="valider" value="VALIDER"> </div> <?php if (isset($_POST['valider']) && strlen($_POST['modele']) < 25) { if (preg_match("#^[A-Z]{1,2}[0-9]{1,3}[A-Z]{1,2}\$#", $_POST['immatriculation'])) { $unAuto = new auto(); $unAuto->renseigner($_POST); $uneConnexion = new BDD("localhost", "testgarage", "root", ""); $uneConnexion->renseigner("vehicule", "marque"); $tab = $unAuto->serialiser(); //$tab['dateinscription']=date("Y-m-d"); $IDG = ""; $IDP = ""; $IDC = ""; $uneConnexion->insert2($tab, $IDG, $IDP, $IDC); $message = "Inscription Validée"; $_SESSION['auth'] = $tab; } else { $message = "Immatriculation invalide"; } } ?> <?php if (isset($message)) { echo $message; } ?> </form> <?php