gabs77
Messages postés379Date d'inscriptionmardi 6 décembre 2005StatutMembreDernière intervention 8 octobre 2008
-
17 oct. 2006 à 19:14
gabs77
Messages postés379Date d'inscriptionmardi 6 décembre 2005StatutMembreDernière intervention 8 octobre 2008
-
18 oct. 2006 à 22:05
slt,
j'ai un pb g une page (classe.php) qui possede toutes les fonctions appartenant a une classe cart
et g une page qui construit la classe (ajouter.php) et j aimerais utiliser la classe pour modifier une donnée pour cela j'utilise $_session mais je n y parviens pas
HELP !!!!
voir.php
<form action="modifier.php" method="POST">
<?php
$tab = $moncart->get_content();
if (isset($_SESSION['cart'])){
$ca=$_SESSION['cart'];
}else{$_SESSION['cart']=array();
$_SESSION['cart']=$tab;
//si je fais echo $_SESSION['cart']['items']; il me renvoie le nb d'élément dans le tablau
}
for ($i=0;$i<=$tab['items']-1;$i++)
{
echo '<tr align="right"><td>'.$tab[$i][0].'</td><td>'.$tab[$i][1].'</td><td>'.$tab[$i][2].'</td>'.
'<td></td>'.
'<td>'.$tab[$i][4].'</td><td>'.round($tab[$i][5],2).'</td></tr>';
}
?>
</form>
modifier.php
<?php
include('class.php');
if (isset($_SESSION['cart'])){
$tab = $_SESSION['cart'];
echo $tab['items'];//ici rien n est retourner sa ne fonctionne pas
for ($i=0;$i<=$tab['items']-1;$i++)
{
$moncart->modify_quantity($tab[$i][0],$_POST['qte['.$i.']']);
}
include('voir.php');
}else{
echo 'sa marche pas ';}
?>