How the Sample Shopping Cart Works

The sample shopping cart application has three components. In this case, they’re rather simplified, but the concepts are the same whether you’re selling five items or you’re Amazon.com. The first component is the catalog. The catalog contains the ID, name, and price for all the items that are sold by the online store. Generally, the catalog is the most sophisticated component of the site. At Amazon.com, not only is the basic name and pricing information included in the catalogs, but so is lots of other information, including reader reviews, editorial reviews, and images of the book covers.

In this case, the catalog is stored in a single flat text file. In Hour 20, “Creating an Online Store,” I’ll explain how ...

Get Sams Teach Yourself CGI in 24 Hours, Second Edition 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.