still not add to cart
<?Php
$_SESSION['cart']=array(); // Declaring session array
array_push($_SESSION['cart'],'flight_time'); // Items added to cart
echo "Number of Items in the cart = ".sizeof($_SESSION['cart'])." ";
?>
Does that not result in a 1 being printed? You've added the word 'flight_time' to the cart. But, you're doing it inside the search page itself, not via a post
to the update-cart page.
From the tutorial:
<form method="post" action="cart_update.php">
This line would be in the search page, it will post all the form contents to cart_update.php
. Then, in cart_update.php you will do things like:
foreach($_POST["product_qty"] as $key => $value){
if(is_numeric($value)){
$_SESSION["cart_products"][$key]["product_qty"] = $value;
}
}
for instance to add a $_POST
variable called 'product quantity' (sent by the search page) to the session cart.