Specifications
As in the last project, we will also build and use a set of function libraries. For this project, we
will use a function API similar to the one in the last project. We will try to confine the parts of
our code that output HTML to a single library to support the principle of separating logic and
content and, more importantly, to make our code easier to read and maintain.
We will also need to make some minor changes to the Book-O-Rama database for this project.
We have renamed the database book_sc (Shopping Cart) to distinguish the shopping cart data-
base from the one we built in Part II.
All the code for this project can be found on the CD-ROM. A summary of the files in the
application is shown in Table 25.1.
TABLE 25.1 Files in the Shopping Cart Application
Name Module Description
index.php Catalog Main front page of site for users.
Shows the user a list of categories in
the system.
show_cat.php Catalog Shows the user all the books in a
particular category.
show_book.php Catalog Shows the user details of a particular
book.
show_cart.php Shopping cart Shows the user the contents of her
shopping cart. Also used to add
items to the cart.
checkout.php Shopping cart Presents the user with complete
order details. Gets shipping details.
purchase.php Shopping cart Gets payment details from user.
process.php Shopping cart Processes payment details and adds
order to database.
login.php Administration Allows administrator to log in to
make changes.
logout.php Administration Logs out admin user.
admin.php Administration Main administration menu.
change_password_form.php Administration Form to let administrator change her
log password.
change_password.php Administration Changes administrator password.
insert_category_form.php Administration Form to let administrator add a new
category to database.
Building Practical PHP and MySQL Projects
P
ART V
544
31 7842 CH25 3/6/01 3:38 PM Page 544










