Code: Select all
$cart = $_SESSION['cart'];
if ($cart) {
$cart .= ','.$_GET['id'];
} else {
$cart = $_GET['id'];
}
$_SESSION['cart'] = $cart;
$column==1;
$items = explode(',',$cart,100);
$inlist = implode(", ",$items);
$contents = array();
foreach ($items as $item) {
$contents[$item] = (isset($contents[$item])) ? $contents[$item] + 1 : 1;
}
$con = mysql_connect($db, $user, $pass) or die(mysql_error());
mysql_select_db($db2) or die(mysql_error());
$query = "SELECT $select FROM $table WHERE id IN ($inlist)";
$result = mysql_query($query);
$column=1;
while($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
$p=$row[id];
$q=$contents[$p];
$c=$row[price];
$_SESSION[$column] =($c*$q);
$column++;
}
$ppp=$column-1;
$ttt=1;
$additives = array();
while ( $ttt <= $ppp ){
$additives[$ttt] = $_SESSION[$ttt];
$ttt++;
}
$_SESSION['total']=array_sum($additives);Code: Select all
$exploded_URL[1]=='signin'Thanks for your input