2 pièce(s) jointe(s)
script pour afficher la date saisie dans un formulaire
bjr,
je suis nouveau, je suis un debutant ds le dvpt web j'utilise dreamweaver-php-mysql.
j'ai concu un simple formulaire me permettant de creer client et de les afficher après un clic.
mais le bémol, arrive premièrement au moment de l'enregistrement je n'ai pas la liste qui s'affiche après le clic. deuxièmement c'est qui me derange encore
le champ date d'enregistrement me renvoi un message d'erreur.
1. creerclient.php :
Code:
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 52 53
| <form action="creerclient_trait.php" method="post" enctype="multipart/form-data"> <table width="43%" border="0" align="center" cellpadding="3">
<caption class="Style1">
Creer client
</caption>
<tr>
<th align="left" scope="row"> </th>
<td align="center"> </td>
<td> </td>
</tr>
<tr>
<th width="38%" align="left" scope="row"><span class="texte">Nom</span></th>
<td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
<td width="57%"> <span class="texte">
<input type="text" name="nom" id="nom" />
</span></td>
</tr>
<tr>
<th width="38%" align="left" scope="row"><span class="texte">Adresses</span></th>
<td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
<td width="57%"> <span class="texte">
<input type="text" name="adresses" id="adresses" />
</span></td>
</tr>
<tr>
<th width="38%" align="left" scope="row"><span class="texte">Telephone</span></th>
<td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
<td width="57%"> <span class="texte">
<input type="text" name="telephone" id="telephone" />
</span></td>
</tr>
<tr>
<th width="38%" align="left" scope="row"><span class="texte">Email</span></th>
<td width="5%" align="center"><span class="texte"><strong>:</strong></span></td>
<td width="57%"> <span class="texte">
<input type="text" name="email" id="email" />
</span> </td>
</tr>
<tr>
<th width="38%" align="left" scope="row"><span class="texte">Date enregistrement</span></th>
<td width="5%" align="center" > <span class="texte"><strong>:</strong></span></td>
<td width="57%"> </td>
</tr>
<tr>
<th scope="row"><span class="texte">
<input type="reset" name="Reset" id="button" value="Annuler" />
</span></th>
<td> </td>
<td align="center"><span class="texte">
<input type="submit" name="button2" id="button2" value="Enregister" />
</span></td>
</tr>
</table> </form> |
2. creerclient_trait.php:
Code:
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
| <?php
$nom=$_POST["nom"];
$adresses=$_POST["adresses"];
$telephone=$_POST["telephone"];
$email=$_POST["email"];
$dateenregistrement=$_POST["dateenregistrement"];
$req="INSERT INTO client
VALUES (NULL,'$nom','$adresses','$telephone','$email','dateenregistrement')";
$res=mysql_query($req) or die("Erreur : ".mysql_error());
if($res){
echo "Insertion effectuée avec succès !";
}
else {
echo "Insertion échouée !";
}
?> |