alweer lang geleden, maar ik heb een probleempje.
ik ben bezig met een soort bestel systeem. Het systeem werkt uiteraard met sessies. De sessie heeft de naam $_SESSION['cart']... heel uniek ook
het probleem wat ik nu ondervindt is, wanneer ik een $.get stuur dat ik de inhoud niet kan zien. als ik naar webadres/cart.php?option=3 zegt het script dat ik ook geen producten erin heb..
wanneer ik via Lytebox 5.5 de pagina webadres/cart.php?option=3 opvraag staat alles er wel normaal in.. iemand een idee?
Hier is mijn script:
<?
include 'config.php';
function getCart(){
$cart = $_SESSION['cart'];
if ($cart) {
$items = explode(',',$cart);
$contents = array();
foreach ($items as $item) {
$contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1;
}
$total = 0;
$output[] = '<table id="ctdropdown">';
$output[] = '<thead>';
$output[] = '<th>Verwijder?</th>';
$output[] = '<th>Naam</th>';
$output[] = '<th>Prijs ps.</th>';
$output[] = '<th>Aantal</th>';
$output[] = '<th>Totaal</th>';
$output[] = '</thead>';
foreach ($contents as $id => $qty){
$query = mysql_query("SELECT * FROM products WHERE `proId`='".$id."'");
$row = mysql_fetch_array($query);
extract($row);
$output[] = '<tr proId="'.$id.'">';
$output[] = '<td class="verwijder">Verwijder</td>';
$output[] = '<td>'.$name.'</td>';
$output[] = '<td>€'.$price.'</td>';
$output[] = '<td>'.$qty.'</td>';
$output[] = '<td> €'.($price * $qty).'</td>';
$total += $price * $qty;
$output[] = '</tr>';
}
$output[] = '</table>';
$output[] = 'Totaal: € '.$total;
echo join('',$output);
echo '<br /><br /> <a href="emptycartnow.php">Leeg uw dienblad!</a><br /><br /> <a href="placeOrder.php">Plaats uw bestelling!</a>';
} else {
echo 'Geen producten';
}
}
?>