Specifications

In this case, we have clicked the View Cart link when our cart is empty; that is, we have not
yet selected any items to purchase.
Figure 25.7 shows our cart a bit further down the track when we have selected two books to
buy. In this case, we have gotten to this page by clicking the Add to Cart link on the
show_book.php page for this book, PHP and MySQL Web Development. If you look closely at
the URL bar, you will see that we have called the script with a parameter this time. The para-
meter is called new and has the value 0672317842
that is, the ISBN for the book we have just
added to the cart.
Building Practical PHP and MySQL Projects
P
ART V
558
FIGURE 25.7
The show_cart.php script with the new parameter adds a new item to the cart.
From this page, you can see that we have two other options. There is a Save Changes button
that we can use to change the quantity of items in the cart. To do this, you can alter the quanti-
ties directly and click Save Changes. This is actually a submit button that takes us back to the
show_cart.php script again to update the cart.
In addition, theres a Go To Checkout button that a user can click when she is ready to leave.
Well come back to that in a minute.
For now, lets look at the code for the show_cart.php script. This code is shown in
Listing 25.9.
31 7842 CH25 3/6/01 3:38 PM Page 558