13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

634 Chapter 28 Building a Shopping Cart<br />

Listing 28.13<br />

checkout.php— Script That Gets the Customer Details<br />

<br />

There are no great surprises in this script. If the cart is empty, the script will notify the<br />

customer; otherwise, it will display the form shown in Figure 28.8.<br />

If a user continues by clicking the Purchase button at the bottom of the form, she will<br />

be taken to the purchase.php script.You can see the output of this script in Figure 28.9.<br />

Figure 28.9 The purchase.php script calculates shipping <strong>and</strong> the final<br />

order total <strong>and</strong> gets the customer’s payment details.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!