Bonjour,

J'ai un formulaire qui devrais inserer des données dans une table, mais à chaque enregistrement j'ai des champs vide ou alors ARRAY, et mes champs date indique 0000.00.00 je ne comprend pas pourquoi.
Voici mon code du fichier FORM
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
<form method="POST"  name="prestations_tvc" action="../enregistrement/validation_tvc.php">
        <table border="0" id="table5" width="931">
                <tr>
                        <td width="453"><font size="2">Date de l'installation :</font><input type="text" name="date_realisation" value = '<? echo $today = date("Y-m-j") ?>' size="20">
                        </td>
                        <td>
                        <p align="right"><font size="2">Date du jour </font>:
                        <input type="text" name="date_encodage" value = '<? echo $today = date("Y-m-j") ?>' size="20"></p>
                        </td>
                </tr>
        </table>
        <table border="0" id="table3" width="935" bgcolor="#C0C0C0" style="background-image: url('../../img/bg.gif')">
                <tr>
                        <td width="69" align="center"><b><font size="1">Ref client</font></b></td>
                        <td width="248" align="center"><b><font size="1">Adresse client</font></b></td>
                        <td width="66" align="center"><font size="2">nom</font></td>
                        <td width="65" align="center"><b><font size="1">code postal</font></b></td>
                        <td width="71" align="center"><b><font size="1">Localité</font></b></td>
                        <td align="center"><b><font size="1">Adresse MAC</font></b></td>
                </tr>
                <tr>
                        <td width="69" align="center">
                        <input type="text" name="ref[1]" size="7"></td>
                        <td width="248" align="center">
                        <input type="text" name="adr[1]" size="36"></td>
                        <td width="66" align="center">
                        <p align="center">
                        <input type="text" name="ref[1]" size="12"></p>
                        </td>
                        <td width="65" align="center">
                        <input type="text" name="postal[1]" size="6"></td>
                        <td width="71" align="center">
                        <p align="center"><input type="text" name="loca[1]" size="12"></p>
                        </td>
                        <td align="center" style="position: relative; float: left">
                                                <p align="left"><input type="text" name="mac[1]" size="2">:<input type="text" name="mac[2]" size="2">:<input type="text" name="mac[3]" size="2">:<input type="text" name="mac[4]" size="2">:<input type="text" name="mac[5]" size="2">:<input type="text" name="mac[6]" size="2"></td>
                </tr>
        </table>
Et voici mon fichier validation
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
 
$date1 = $_POST['date_realisation'];
$date2 = $_POST['date_encodage'];
$user = $_POST['user'];
$ref = $_POST['ref'];
$adr = $_POST['adr'];
$code = $_POST['postal'];
$localite = $_POST['loca'];
$address_mac = $_POST['mac'].":".$_POST['mac'].":".$_POST['mac'].":".$_POST['mac'].":".$_POST['mac'].":".$_POST['mac'] ;
$tech = $_POST['technicien'];
$heure_debut = $_POST['ha1'].":".$_POST['ha2'];
$heure_fin = $_POST['hd1'].":".$_POST['hd2'];
$commentaire = $_POST['com'];
 
echo '<pre>';
var_dump($_POST);
echo '</pre>';
var_dump($commentaire);
var_dump($heure_fin);
var_dump($heure_debut);
var_dump($tech);
var_dump($address_mac);
var_dump($localite);
var_dump($code);
var_dump($adr);
var_dump($ref);
var_dump($date2);
var_dump($date1);
 
/******************************************************************************************************************************************************
                    Date
******************************************************************************************************************************************************/
 
 
 
 
 
 
 
 
/*****************************************************************************************************************************************************
                                                                  Insertion dans la base
*****************************************************************************************************************************************************/
 
                                           $sql="INSERT INTO prestation_beta (IDot, date_realisation, date_encodage, nom_utilisateur, ref_client,                                                       adr_client, code_postal, commune, adr_modem, technicien, heure_debut, heure_fin, commentaire) values (                                                 '".$date1."','".$date2."','".$user."', '".$ref."', '".$adr."','".$code."','".$localite."','".                                                          $address_mac."', '".$tech."','".$heure_debut."','".$heure_fin."','".$commentaire."')";
 
 
                                             $insert = mysql_query($sql) or die (mysql_error());
Quelqu'un voie t'il erreur ???

D'avance merci