Bonjour,
J'ai un script qui me permet de cocher des informations des informations issues d'une base de donnees et de les poster pour les afficher apres.
Je suis rendu compte que lorsque je coche tout ça marche mais lorsque je coche que quelques éléments ça affiche plus les references et stock. Plz aidez moi
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 <form action="valide.php" method="post" > <?php $req = mysql_query("SELECT * FROM products_options Order by products_options_name "); while( $result = mysql_fetch_array($req)) { ?> <table> <tr> <td><input type=checkbox name="id[]" id="id" value=<?php echo $result['products_options_id'];?>></td> <td><input type="text" name="prix[]" id="prix" value=<?php echo $result['prix'];?>></td> <td><input type="text" name="stock[]" id="stock" value=<?php echo $result['stock'];?>></td> <td><input type="text" name="reference[]" id="reference" value=<?php echo $result['reference'];?> ></td> </tr> <?php } ?> </table> <input value="Ajouter ces Options" type="submit" name="submit"> </form>
Apres j'ai l'autre page
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 $prix=$_POST['prix']; $stock=$_POST['stock']; $reference=$_POST['reference']; $id=$_POST['id']; $total=count($id); echo" <table width=250 border=0 align=center cellspacing=1 bgcolor=black> <tr bgcolor=#CCCCCC> <td width=150>Reference</td> <td width=50>Stock</td> <td width=50>Prix</td> </tr> "; // for($i=0;$i<$total;$i++){ echo " <tr bgcolor=white> <td>$reference[$i]</td> <td>$stock[$i]</td> <td>$prix[$i]</td> </tr> "; }
Partager