Bonjour à tous,
Je créé les lignes de mon tableau avec un for. Par contre je voudrais récupérer les valeurs sur la page suivante en post, mais je récupère que la dernière ligne et pas les deux. Comment faire ?
Merci d'avance
Page du tableau
Page de traitement
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 <?php for ($n=0; $n<2; $n++) { ?> <tr align="center"> <td><input style="text" id ="date_paiement" name="date_paiement" size="12" value="<?php echo $date_fact; ?>"></td> <td><input style="text" name="montant_paiement" size="10" value="80"></td> <td><select name="type_paiement"> <?php $sql_moyen = 'SELECT * FROM moyen_paiements'; $req_moyen = mysql_query($sql_moyen) or die('Erreur SQL !<br>'.$sql_moyen.'<br>'.mysql_error()); while($moyen = mysql_fetch_assoc($req_moyen)) { echo "<option value='".utf8_encode($moyen['id_moyen_paiements'])."'>".utf8_encode($moyen['nom_moyen_paiements'])."</option>"; } ?> </select></td> <td><input style="text" name="domiciliation_paiement" size="15" value=""></td> <td><input style="text" name="numero_paiement" size="10" value=""></td> </tr> <?php } ?>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 $date_paiement = stripslashes($_POST['date_paiement']); $montant_paiement = stripslashes($_POST['montant_paiement']); $type_paiement = stripslashes($_POST['type_paiement']); $domiciliation_paiement = stripslashes($_POST['domiciliation_paiement']); $numero_paiement = stripslashes($_POST['numero_paiement']); $id_fact = stripslashes($_POST['id_fact']); $req_inscription = 'INSERT INTO paiements (date_paiements, montant_paiements, type_paiements, domiciliation_paiements, numero_paiements, id_facture_paiements, etat_paiements) VALUES ("'.$date_paiement.'", "'.$montant_paiement.'", "'.$type_paiement.'", "'.$domiciliation_paiement.'", "'.$numero_paiement.'", "'.$id_fact.'", "0")'; $res_inscription = mysql_query($req_inscription)or die(mysql_error());
Partager