ABSTRACT

This chapter demonstrates methods for securely implementing a shopping cart and purchasing items through PayPal using a combination of JQuery, AJAX, and PDO in a JQuery Mobile client.

The main techniques involved are: • Displaying a catalog of items • Adding and deleting items to the cart via AJAX • Safely storing cart values in a session variable • Validating and sanitizing user input • Preparing data for PayPal • Storing purchase data via PDO prepared statements

The store and the shopping cart are displayed here.