Chapter 5. Building a Shopping Cart

In This Chapter

  • Designing the shopping cart

  • Building the shopping cart database

  • Writing code for the Web pages

  • Writing code for the application scripts

The Internet provides endless opportunities to buy things. You browse or search a Web page; choose the items you want; provide your name, address, credit card number, and other information; and the items show up on your front porch in the near future. Isn't the Internet wonderful?

This chapter shows you how to develop a system that provides product information and a shopping cart to purchase the items. We include the online catalog as part of the shopping cart. This application uses the online catalog that was developed in Chapter 4 in this minibook, expanded to include functionality that allows users to purchase the products in the catalog.

The online ordering system described in this chapter requires you to build a MySQL database with several tables. You can create the database with SQL statements or with phpMyAdmin. Methods for creating the database and adding data to it are discussed in Book III.

Get PHP & MySQL® Web Development All-in-One Desk Reference for Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.