salut
voila mon probleme:
j´ai un pannier sur mon site cependant lorsque j´ajoute un nouveau produit toutes la colonne du libelle et de du prix changent et prennent comme valeur le libelle et le prix du dernier produits.
voila mon code:
<?
if (! isset($_SESSION[´panier´]) )
{
$_SESSION[´panier´] = array();
}
$produit = $_GET[´noprod´];
$lib = $_GET[´liprod´];
$pu=$_GET[´pu´];
if (isset($_SESSION[´panier´][ $produit ]) ){
$_SESSION[´panier´][ $produit ] += 1;
}
else
{
$_SESSION[´panier´][ $produit ] = 1;
}
if (isset( $_SESSION[´panier´] ) )
{
echo "<H2>Votre panier</H2><TABLE
BORDER=\"1\"><TR><TH>Produit</TH><th>Libelle</th><
TH>Quantité</TH><th>Prix unitaire</th></TR>";
foreach ($_SESSION[´panier´] as $produit => $quantite)
echo "<TR><TD> $produit </TD><td> $lib </td><TD> $quantite </TD><td>$pu</td></TR>";
}
echo ´</TABLE><a href="index.php?env=1" style="color:red">valider votre commande</a><br>´;
echo ´<a href="index.php?eff=1" style="color:red">effacer le pannier</a><br>´;
echo ´<a href="index.php" style="color:red">retour</a>´;
?>