Later this year I’m going to write an e-commerce with PHP and MySQL book for Peachpit Press. This is a topic that’s often been requested by my readers and one I’m happy to finally address. I have written e-commerce chapters in my PHP 6 and MySQL 5 for Dynamic Web Sites: Visual QuickPro Guide and PHP 5 Advanced: Visual QuickPro Guide books, but not to this extent. Specifically, those examples were unable to demonstrate the payment gateway system, as that’s so particular to each individual situation. This new book, whose title is still being determined, will cover everything you need to know to create an e-commerce site using PHP and MySQL. I’m going to describe my intentions for the book here, then ask for any questions, comments, and suggestions that you, the potential reader, may have.
UPDATE: I’ve just posted the rough table of contents. My apologies for the delay on this and my sincerest thanks to those interested in the book!
First of all, to be absolutely clear, the book will not teach PHP and MySQL, or HTML and CSS. The book will have to assume knowledge of those, making this entire book much more of an application of the technologies kind of guide (like the example chapters in my PHP and MySQL books). However, most readers will likely still learn some aspects of PHP, MySQL, HTML, and CSS that they didn’t know before. Also, this book will not be in Peachpit’s QuickStart or QuickPro series, in which specific topics are introduced, discussed, then demonstrated in step-by-step format. This book will be in New Riders’ Voices That Matter series (New Riders is a sibling publisher to Peachpit). That format does away with the steps and redundancy of showing the code in both step-by-step and entire script formats. This series will allow me to go into more detail on the why’s of the code, as well as include more, and prettier, images.
My hope, depending upon space constraints, is to use two separate examples in order to best describe every step of the way. One example would be content that’s delivered immediately and online. This could be PDFs or just subscriptions/access to content. The other example would be content that’s physical and shipped at a later point. The differences between the two are significant because:
- You cannot actually charge a user until the item they purchase ships.
- When that’s the case, additional administrative pages are required to indicate that the order has shipped.
So the online content example would use an immediate payment system and delivery of the content. The physical product example would place a hold on the user’s card, to be charged when the order ships.
The online content would also have a simpler database design; the physical products would be require a more complex design.
I also plan on using two different payment gateways, so you can get a sense of how different gateways work. One would be the popular PayPal, the second is yet to be determined.
My intention is to use only procedural programming, which will be accessible to the largest body of readers. The only exception would be if I decide to use a framework, like the Zend Framework, for one of the examples. If I do go that route, basic OOP would have to be used, although it should still be understandable by most readers.
Of course, being e-commerce, security will be discussed often, at length, and in detail. This includes everything from hosting issues to HTTPs connections to storing data.
I would hope to implement search functionality. As for other features, like customers being able to review items, make purchases without registering, etc., will probably have to be briefly discussed instead of demonstrating. Again, what I’m trying to accomplish is coverage of the most important information from a couple of view points.
So, what do you think? What would you like to see or not see? Any question and comment is welcome and much appreciated, just be aware that I need to approve comments before they appear, for security and integrity reasons. Thanks!