Specifications

display_button(“show_cart.php”, “continue-shopping”, “Continue Shopping”);
do_html_footer();
?>
There are no great surprises in this script. If the cart is empty, the script will notify the cus-
tomer; otherwise, it will display the form shown in Figure 25.8.
If a user continues by clicking the Purchase button at the bottom for the form, she will be taken
to the purchase.php script. You can see the output of this script in Figure 25.9.
Building Practical PHP and MySQL Projects
P
ART V
568
LISTING 25.13 Continued
FIGURE 25.9
The purchase.php script calculates shipping and the final order total, and gets the customers payment details.
The code for this script is slightly more complicated than the code for checkout.php. It is
shown in Listing 25.14.
LISTING 25.14 purchase.phpThis Script Stores the Order Details in the Database and
Gets the Payment Details
<?
include (‘book_sc_fns.php’);
// The shopping cart needs sessions, so start one
31 7842 CH25 3/6/01 3:39 PM Page 568