Shopping Cart Using PHP and MySQL

The course will demonstrate how to build a shopping cart from scratch. Participants will learn intermediate to advanced use of PHP and MySQL, particularly the use of cookies and sessions to maintain state, and the security aspects of coding for e-commerce sites, or any other site handling sensitive information.

Applicable Job Roles: web programmers, and web application developers.

Week 1
  • Review of PHP knowledge (especially array handling and MySQL functions)
  • Review of MySQL knowledge
  • Good coding practices
  • Writing functions: students will develop their own functions to access and query a MySQL database
Week 2:
  • Working with arrays: useful PHP functions and how to use them
  • Create and populate the database
  • Output a simple list of products with images
Week 3:
  • Understand the concept of 'statelessness'
  • System design: techniques for determining the system flow for the application
  • Building a wireframe of the application
  • Setting up the coding environment: templates, include files, libraries
Week 4:
  • Using sessions in PHP
  • Building the cart: adding, removing, and changing quantities
  • Viewing the cart
Week 5:
  • Future-proofing your code: good practice
  • More on sessions: security
  • The checkout process: calculate simple shipping and tax, build checkout form
Week 6:
  • Validating user input using classes for extensible, re-usable code
  • Preparing data for insertion to the database
  • Updating the database
Week 7:
  • Interfacing with a payment processor for online credit card payments
  • Using a class to send emails to merchant and customer
  • Security considerations
Week 8:
  • Final review of cart
  • Error handling
  • Enhancing the cart
  • Don't Repeat Yourself: using libraries and classes to encapsulate and re-use code
'Introduction to PHP' course (P100) or equivalent knowledge is required. Some basic knowledge of SQL is useful
Access to a webhost running PHP (at least version 5.x) and MySQL (version 5.x). Students may choose to load PHP and MySQL on their local systems, but this is not necessary. If a student chooses to do a local installation, she or he should understand that debugging installations is not within the scope of this course and that assignments must still be posted in working order to an accessible online account for grading.

Required Book PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide (4th Edition)
Suggested Book Programming PHP

Additional information:

Your place in the course is confirmed by your payment. Introductory courses are intended for students with no experience in the subject matter and are seeking beginner level training.

Refund Policy: Please read our Terms and Refund Policy before registering for this course.

Additional Cost: Book and software might be required for the course. Read the Requirements and Book section for more information. Course fee does not include the book and software cost .

How eClasses Work:Instructors post lectures (text-based, no video or audio), reading selections, and hands-on assignments once a week in the online classroom. Students can discuss the assignments with the instructor and amongst themselves in the classroom area. This format has no set meeting time, which allows students to attend class at a time most convenient to them, yet still provides logically organized communication between class participants. Students can apply for the completion certificate after finishing the class.


Price: $300.00
IWA Member Price: $200.00
Course No.: P104
Instructor Veronica Yuill
CEUs 4
Duration 8 weeks
Cost 80
Open Courses:

Sorry, no other session is scheduled for this course. You can add this course to your wish list and we will notify you when other sessions are scheduled.


Instructor's Profile:
InstructorWith over twenty years' experience of systems analysis, database design, and programming, Veronica specialises in creating dynamic, database-driven websites and intranet applications using PHP, MySQL, and Oracle. From 1999 to 2004, she also taught on a ground-breaking online degree course offered by the Open University. Since 2003, she has tutored online undergraduate courses forming part of the UK's Open University's Certificate in Web Application Development, and is now chair of the presentation team for the ColdFusion and MySQL course.
Before you register for this class, please read the Outline, Prerequisites, Requirements, Books, and Refund Policy sections carefully.


"This is one of the toughest courses that I have ever taken. That being said, it's also the one course out of which I have gotten the most. Be prepared to put a lot of effort into this class and the rewards will be great. The instructor, Veronica, is very good and will help you along the way, without handing you the answer. She encourages you to think on your own and discover the answers for yourself. Not only did I learn the technologies Veronica was teaching, but I honed my code debugging skills as well. This is not one of those classes that you can just breeze through. However, for anyone who is self-taught, as I am, I highly recommend this course. You will fill in many gaps that you may not even know exist in your knowledge of things such as PHP, MySQL, arrays, user-defined functions, form validation, and more. Just be prepared to put in an appreciable amount of time. And good luck!" - Raymond Flash
"Wonderful course. I learned a lot. The teacher was very knowledgeable and quickly responded to our queries. Although the course was packed with material, I would have enjoyed further assignments involving a real (sandbox) gateway but since the course is already jam packed, the course would have to be extended to accommodate the new material. Also, security is very important in this course. A book that I found as helpful or even more so than the regular text is Essential PHP Security. Veronica covered this material using various links on the web but the book provided great in depth discussions with wonderful examples. I would suggest that you put it on the suggested book list." - John Saxon