Bonjour à tous,
Je me permets de demander votre aide car je patauge.
Je suis entrain de me constituer un petit backend pour gérer des tarifs qui s'appliquent sur des formulaires de commandes.
J'ai une table contenant les départements français ainsi que 7 tarifs différents pour chacun de ces départements.
J'ai donc créer pour les afficher ceci (version simplifiée) :
Code php : 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 $reponse = "SELECT nom, code, tarif_a, tarif_b, tarif_c, tarif_d, tarif_e, tarif_f, tarif_g FROM matable"; $req = mysql_query($reponse) or die(mysql_error()); ?> <html> <body> <form method="post" action="maj_tarifs_norm.php" > <table> <tr> <th>Département</th> <th>Code</th> <th>Tarif A</th> <th>Tarif B</th> <th>Tarif C</th> <th>Tarif D</th> <th>Tarif E</th> <th>Tarif F</th> <th>Tarif G</th> </tr> <?php while($donnees = mysql_fetch_array($req)) { ?> <tr> <td><?php echo $donnees['nom']; ?></td> <td><?php echo $donnees['code']; ?></td> <td class="input"><input type="text" name="tarif_a" value="<?php echo $donnees['tarif_a']; ?>" size = "3"/></td> <td class="input"><input type="text" name="tarif_b" value="<?php echo $donnees['tarif_b']; ?>" size = "3"/></td> <td class="input"><input type="text" name="tarif_c" value="<?php echo $donnees['tarif_c']; ?>" size = "3"/></td> <td class="input"><input type="text" name="tarif_d" value="<?php echo $donnees['tarif_d']; ?>" size = "3"/></td> <td class="input"><input type="text" name="tarif_e" value="<?php echo $donnees['tarif_e']; ?>" size = "3"/></td> <td class="input"><input type="text" name="tarif_f" value="<?php echo $donnees['tarif_f']; ?>" size = "3"/></td> <td class="input"><input type="text" name="tarif_g" value="<?php echo $donnees['tarif_g']; ?>" size = "3"/></td> </tr> <?php } ?> </table> <input type="submit" value="Envoyer" /> </form>
J'ai mis volontairement les valeurs des tarifs dans des <input/> car j'aimerai pouvoir modifier également ces valeurs.
Disons que je modifie tarif_a pour le département 31.
En partant de là, comment puis-je récupérer ces valeurs modifier pour pouvoir les insérer dans ma table ?
Comment récupérer ces valeurs avec POST ? Je n'arrive pas en fait à trouver comment m'y prendre.
Merci d'avance![]()








Répondre avec citation



Partager