Bonjour,

J'ai un problème avec mon script. Je voudrais que le client puisse modifier la quantité de produit mais je ne sais pas comment faire.

Donc comment faire ?

Merci d'avance !

Mon code source :
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
49
50
51
52
53
54
55
56
57
58
59
<?php
session_start();
include("haut.php");
include("menuhor.php");
include("recherche.php");
include("info.php");
 
if (!empty($_POST['article_id']) && !empty($_POST['quantite']) && !empty($_POST['article_name']) && !empty($_POST['prix']))
{
 
 
$select = array();
$select['id'] = htmlentities($_POST['article_id']);
$select['qte'] = htmlentities($_POST['quantite']);
$select['article'] = htmlentities($_POST['article_name']);
$select['prix'] = htmlentities($_POST['prix']);
 
$_SESSION['panier'][] = array('id' => $select['id'], 'prix' => $select['prix'], 'qte' => $select['qte'], 'article' => $select['article']);
 
 
}
if ( !empty($_SESSION['panier']))
{
echo '<h1> Votre panier : </h1>';
echo '<div id="tableau_panier">';
echo '<table>';
echo '<tr>';
echo '<th> </th>';
echo '<th width="150"><img src="images/nom.jpg" alt="Nom" border="0"/></th>';
echo '<th width="50"><img src="images/prix.jpg" alt="Prix" border="0"/></th>';
echo '<th width="50"><img src="images/quantité.jpg" alt="Quantite" border="0"/></th>';
echo '</tr>';
echo '<tr>';
foreach($_SESSION['panier'] AS $panier)
{
 
echo'<td> <img src="images/'.$panier['id'].'.jpg" alt="Image du produit" border="0" width="100px" "/> </td>  ';
echo '<td align="center"> '.$panier['article'].' </td>';
echo '<td align="center"> '.$panier['prix'].' 	&euro; </td>';
echo '<td align="center">'.$panier['qte'].'</td>';
echo '</tr>';
echo '<td align="center"></td>';
 
 
}
  echo '</table>';
echo "</div>";
}
 
else
{
?>
<div id="paniervide">
<img src="images/panier_vide.gif" alt="Panier vide" border="0" /> 
</div>
<?php
}
 
 include("bas.php") ; ?>