1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| <?php
mysql_connect("localhost", "root", "");
mysql_select_db("gestion");
if(isset($_POST['valider'])){ //test si on a cliqué sur le bouton
if (empty($_POST['nom']) or empty($_POST['prenom']) or empty($_POST['civilite'])) {
echo "<script>alert('formulaire incomplet');</script>";
}
else{
$NC=$_POST['NC'];
$civi=$_POST['civilite'];
$nom=$_POST['nom'];
$prenom=$_POST['prenom'];
mysql_query("INSERT INTO client VALUES('$NC','$civi' , '$nom', '$prenom', '1', '1', '1','1', '1','1', '1','1', '1','1', '1', '1')");}
}
?> |
Partager