1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| session_start();
$prixart=0;
if (isset ($_SESSION['email']))
{
if ((isset($_GET['id'])) and (isset($_GET['type'])) and (isset($_GET['prix'])))
{
$idart=$_GET['id'];
$typeart=$_GET['type'];
$prixart=$_GET['prix'];
$_SESSION['somme']=$_SESSION['somme']+$prixart;
$_SESSION['achats'][]=array("id"=>$idart, "type"=>$typeart, "prix"=>$prixart );
//echo $somme;
var_dump('<pre>',$_SESSION,'</pre>');
foreach ($_SESSION['achats'] as $article)
{
echo $article['id'].'-'.$article['qte'].'<br>';
}
}
} |
Partager