Specifications

The front page of the site is produced by the script called index.php. The output of this script
is shown in Figure 25.3.
Building a Shopping Cart
C
HAPTER 25
25
B
UILDING A
SHOPPING CART
549
FIGURE 25.3
The front page of the site lists the categories of books available for purchase.
You ll notice that, in addition to the list of categories on the site, there is a link to the shopping
cart in the top-right corner of the screen and some summary information about whats in the
cart. This will appear on every page while a user browses and shops.
If a user clicks one of the categories, shell be taken to the category page, produced by the
script show_cat.php. The category page for the Internet books section is shown in Figure 25.4.
All the books in the Internet category are listed as links. If a user clicks one of these links,
she will be taken to the book details page. The book details page for one book is shown in
Figure 25.5.
On this page, as well as the View Cart link, we have an Add to Cart link in which the user can
select an item. Well return to that when we look at how to build the shopping cart later.
Lets look at each of these three scripts.
31 7842 CH25 3/6/01 3:38 PM Page 549