case 3: echo "Connect fail"; break; case 4: echo "Error email/password"; default: echo "Données KO"; } } if (isset($_POST['btnsignin'])) { $controleur = new Controleur(); if (htmlentities(addslashes($_POST['passwordSign'])) != htmlentities(addslashes($_POST['passwordSignRepete']))) { echo "password et password repete KO"; } else { //si champs ok $res = $controleur->addUser(htmlentities(addslashes($_POST['emailSign'])), htmlentities(addslashes($_POST['passwordSign'])), htmlentities(addslashes($_POST['nameSign']))); switch ($res) { case 1: echo "L'email existe deja"; break; case 2: echo "Inscription OK"; break; case 3: echo "Inscription KO"; break; default: echo "Données KO"; } } }