1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
if (!empty($_POST)) {
if(!empty($_POST['nom']) && ($_POST['prenom']) && ($_POST['telephone']) && ($_POST['adresse']) && ($_POST['cp']) && ($_POST['ville']) && ($_POST['mail']) ){
extract ($_POST);
$req = $bdd->prepare('INSERT INTO clients (nom, prenom, telephone,adresse, cp, ville, mail) VALUES(?, ?, ?, ?, ?, ?, ?)');
$req->execute(array($_POST['nom'], $_POST['prenom'], $_POST['telephone'], $_POST['adresse'], $_POST['cp'], $_POST['ville'], $_POST['mail']));
$success='<strong>Success :</strong> la page été ajouté avec succes';
} else {
$error = '<strong>Ereur :</strong> Il faut remplir tous les champs.';
}
}
?>
<h1><img src="img/icons/document-2-add.png" alt=""> Nouvelle Intervention</h1>
<?php if (!empty ($success)) { echo '<div class="notif success bloc">' .$success.'<a href="#" class="close">x</a></div>'; } ?>
<?php if (!empty ($error)) { echo '<div class="notif error bloc">' .$error.'<a href="#" class="close">x</a></div>'; } ?>
<div class="bloc left">
<div class="title"> Information Client </div>
<div class="content">
<form method="POST" action="ajouter.php">
<div class="input">
<label for="nom">Nom :</label>
<input type="text" id="nom" name="nom" required>
<label for="prenom">Nom :</label>
<input type="checkbox" id="prenom" name="prenom" class="iphone"> |
Partager