Merci xTG c'est vrai que c'est tout bête ! j'ai placé le inc après le traitement pour l'ajout d'article & c'est bon ça se met à jour.
mais pour ma page panier.php, j'ai les traitements dans le "body".
VOici mon code, en fait que je change le nombre d'article ou supprime, le panier ne se met pas à jour , voici mon code
<?php
session_start();
require_once('inc/connexion_base.inc.php'); // connexion à la base de données
include_once("inc/tete.inc.php");
/* ***** début de la page *****************/
echo "<div class=\"fdservice\">";
echo "<div id=\"ajout_img\"></div><p> </p>";
echo "<p class=\"legend_contact\">France Automate : votre panier</p>";
// modification de la quantité du panier (second passage)
if(isset($_POST["nouv_qte"])){
// récupération des variables
$nouv_qte=$_POST["nouv_qte"];
$indice=$_POST["indice"];
if($nouv_qte==0){
// si la nouvelle quantité est 0, on supprime la ligne
unset($_SESSION["panier"][$indice]);
if(!isset($_SESSION["panier"])){
// si le panier est vide
echo "<p> </p><p> </p>";
echo "<p class=\"serv\">Votre panier est vide !</p>";
}
}else{
// sinon on modifie la quantité
$_SESSION["panier"][$indice]["quantite"]=$nouv_qte;
}
}
// si il n'y a plus d'articles dans le panier (second passage)
if(isset($_SESSION["panier"]) && (isset($_GET["suppr"]) || count($_SESSION["panier"])==0))
{
unset($_SESSION["panier"]);
}
// vérification du panier
if(!isset($_SESSION["panier"])){// si le panier est vide
echo "<p> </p><p> </p>";
echo "<p class=\"serv\">Votre panier est vide !</p>";
} else {
// récupération du panier dans la session
$panier=$_SESSION["panier"];
?>
<table id="rounded-corner">
<tr>
<th align="left" colspan="2">Article</th>
<th align="left">Version</th>
<th align="right" nowrap >Quantité</th>
<th align="right" nowrap >Prix unitaire</th>
<th align="right" nowrap >Frais de Port</th>
<th align="right">Prix total</th>
</tr>
<?php
$total=0; // total de la commande
// affichage des articles
foreach($panier as $indice=>$article){
$sql="SELECT * FROM distributeur WHERE id_dist=".$article["idD"];
$res=mysql_query($sql) or die(mysql_error());
$dist=mysql_fetch_assoc($res);
$sous_total=$article["prix"]*$article["quantite"]+$article["port"]*$article["quantite"];
?>
<form action="panier.php" method="post" name="form<?php echo $indice; ?>">
<tr>
<td align="left" colspan="2" nowrap><a href="fiche_distributeur.php?idT=<?php echo $article["idt"]; ?>&idD=<?php echo $article["idD"]; ?>"><?php echo $article["nom"]; ?></a></td>
<td align="left"><?php echo $dist["version"]; ?></td>
<td align="right">
<select name="nouv_qte" onchange="document.form<?php echo $indice; ?>.submit();">
<?php for($i=0;$i<=10;$i++){
if($i==$article["quantite"]){
echo "<option value=\"$i\" selected=\"selected\">$i</option>";
}else{
echo "<option value=\"$i\">$i</option>";
}
}
?>
</select>
<td align="right" nowrap><?php echo number_format($article["prix"], 2, ',', ' '); ?> €</td>
<td align="right"><?php echo number_format($article["port"], 2, ',', ' '); ?> €</td>
<td align="right" nowrap><?php echo number_format($sous_total, 2, ',', ' '); ?> €</td>
<td style="background-color:#ffffff;">
<input type="hidden" name="indice" value="<?php echo $indice; ?>"/>
<input type="image" name="sup" src="images/supprimer.gif" onclick="javascript:document.form<?php echo $indice; ?>.nouv_qte.value='0';document.form<?php echo $indice; ?>.submit();"/>
</form>
</td>
</tr>
<?php
$total+=$sous_total; // ajout au total
}
?>
<tr><td> </td><td> </td><td> </td><td> </td>
<td colspan="3" class="total">Total TTC : <b><?php echo number_format($total, 2, ',', ' '); ?> €</b></td>
</tr>
</table>
<p><a href="panier.php?suppr=tout">Vider le panier </a> </p>
<p><a href="commande.php">Passer la commande </a> </p>
<?php
}//fin si else
echo "<p> </p><p> </p>";
echo "</div>";
echo "<p> </p><p> </p>";
include_once("inc/footer.inc.php");
?>