Bonjour ,
Ben voila ,enfet j ai créé un panier virtuel mais quand je me rend sur la page de se panier , il ne m'affiche pas d'erreurs ; le probleme c'est qu'il ne m affiche rien du tout !!! .C'est surement du a une erreur (voir des erreurs)mais je n'arrive pas a trouver d'ou elle proviennent !
donc si quelqu'un aurait une idée de mon probleme merci de me la proposer
voila mon code (il est mal codé car c'est la premiere fois que je fait un caddie et je m'en sortait plus donc désoler d'avance pour cela

)
code :
<?php
session_start();
if ($_GET['ajout'] == "AJOUT")
{
$_SESSION['achats'][] = array (
"id" => $_GET['id'],
"qte" => $_GET['qte']
);
}
if ($_GET['retirer'] == "RETIRER")
{
for ($i=0; $i < count($_SESSION['achats']; $i++)
{
if ($i == $_GET['id_produit'] )
{
array_splice($_SESSION['achats'], $i, 1);
}
}
}
?>
<table width="100%" border="0">
<tr>
<td> </td>
<td> </td>
<td><div align="center"><strong>Nom</strong></div></td>
<td><div align="center"><strong>Image</strong></div></td>
</tr>
<?
while ($i=0; $i < count($_SESSION['achats']); $i++){
$query = mysql_query("SELECT * FROM produit WHERE id='$achat[$i]'");
$val= mysql_fetch_array($query);
$image=$val[image];
$id_prod=$val[id];
$nom=$val[nom];
?>
<tr>
<td width="10%"><div align="center"><a href="index.php?page=caddie.php&retirer=RETIRER&id_produit=<? echo $id_prod ?>">Supprimer</a></div></td>
<td width="55%">
<? for ($i=0; $i < count($_SESSION['achats']); $i++)
{?>
<select name="qte=<? $i ?>">
<option value="1"
<?=($_SESSION['achats'][$i]['qte'] == 1 ? "SELECTED" : null;?>
></option>
<option value="12"
<?=($_SESSION['achats'][$i]['qte'] == 2 ? "SELECTED" : null;?>
>
<!-- etc. -->
</option>
</select><? }?></td>
<td width="55%"><? echo $nom ?>
<div align="center"></div></td>
<td width="35%"><div align="center"><strong><img src="/images/<? echo $image; ?>" width="104" height="72"></strong></div></td>
</tr>
<?
$i++;
}
?>
</table>
<p>>>Valider la commande ... </p>
VOILA , MERCI D'AVANCE ++