Archives For book

I’m very pleased to say that I’m in the process of wrapping up my next book, “Effortless E-Commerce with PHP and MySQL”. I’ve  completed the writing of all eleven chapters. Now I’m in the process of reviewing the PDF layouts of the chapters, which I’ll finish over the weekend (the book goes to the printer on Tuesday). Overall I think the book turned out quite well, although you’d expect me to say that! Unfortunately I did have to cut a couple of “bonus” chapters out, as I ran out of pages (the publisher institutes a hard limit on a book’s length), but I should be able to explain most of the bonus materials in blog postings here. I’ll post the final table of contents separately, and I still need to put the code for the second example online (actually, I need to create the official Web site for the book, too), but I wanted to quickly mention some of the book’s highlights, in no particular order:

  1. The book uses a free-flowing format. Most of the books I write are in Peachpit Press’s Visual QuickPro Guide or Visual QuickStart Guide series, which is fairly structured (two-column layout, etc.). This book is under the New Riders label, so it’s not pre-scripted in any way. This means that complicated bits of code get developed in a series of steps, with explanations; simple bits of code and very basic scripts just get presented in their entirety.
  2. There are two complete e-commerce example sites developed in the book. The two have very few overlapping features, so you’ll see lots of ways to do things. For example, how you perform MySQL queries using PHP is presented three different ways: the standard, direct method; using prepared statements; and using stored procedures. How to address the HTML-PHP relationship is also presented in two different ways. You’ll see how to do a site that requires registration and one that does not. You’ll manage inventory for physical products, create virtual content, setup repeating payments, and authorize credit card holds to be debited later. It’s very much a buffet of ideas, allowing you to pick and choose those you like best or are most appropriate for your e-commerce sites.
  3. You’ll get both the bigger picture (of the process, finding a host, developing a site, etc.) and lots of specific code and recommendations. The book teaches not just how to do things, but why you would want to do them this way or another way. In other words, there’s a larger proportion of theory discussed.
  4. Security is hammered constantly. The second chapter is all about security, from a general approach to preventing common attacks. All of the other chapters also use secure techniques but, just as importantly, indicate simple things you might casually have done, that have terrible security implications.
  5. The examples use third-party libraries for extra features. You’ll see how to integrate a WYSIWYG editor into a form so that an administrator can add HTML content. You’ll also apply three different, but simple, uses of the jQuery framework. And the Zend_Mail component of the Zend Framework is used so that an HTML or plain text version of an order receipt can be sent to the customer upon completing his or her order.
  6. Secure uploading of PDF and image files.
  7. The second e-commerce example uses an MVC (Model-View-Controller) approach to development, without tapping into a framework or requiring object-oriented programming. There’s a huge security and performance benefit by placing almost all of the database logic within the database (i.e., the Model). And all of the HTML is written into separate files (the View). The remaining PHP code (the Controller) is sparse and clean.
  8. I developed two versions of a really nice user-defined function for creating form elements, with the ability to handle both existing values (i.e., to make the form “sticky”) and error reporting.
  9. PHP’s relatively new Filter extension is used to validate many values.
  10. There are tons of recommendations for how you can modify and extend the examples. I think about half the chapters conclude with 3-5 pages of ideas, including that specific HTML, PHP, and MySQL, required to accomplish those alterations.

So there you have a somewhat random ten highlights of the book. Having written nearly 20 books over the past 10 years, over half of them involving PHP and MySQL in some capacity, I worry about giving readers something new and interesting. If you’re paying $20-30 for a book, you should feel like you’re not just getting a different wrapper on something I’ve already written. I think I really succeeded on that note here. And I hope you’ll feel the same.

My thanks, as always, to everyone who has provided feedback on this book idea and have expressed their interest in it. The book is currently listed at Amazon.com for $23.09 (the MSRP is $34.99). I’ll continue to post updates about its status here.

Choosing a Payment Gateway

September 16, 2010

In my forthcoming “Effortless E-Commerce with PHP and MySQL” book (which is pretty much my only focus these days), I wanted to use two different payment systems. This was part of my overall approach of trying to present as big of a picture as possible as to what “e-commerce” is. For the book’s first example, I wanted to use PayPal. Many developers don’t like PayPal, but for customers, it’s the most recognizable name, and that’s critical when it comes to customers being comfortable spending money at a site. People traditionally think of PayPal’s as a system where the customer leaves the e-commerce site, goes to PayPal’s site, and hopefully returns to the original e-commerce site after making the purchase. This is formally called PayPal’s Website Payments Standard, and is demonstrated in my book. In that example, I make use of PayPal’s IPN (Instant Payment Notification) system, so that the site is notified as soon as the payment is made, whether or not the customer actually returns to the e-commerce site immediately thereafter. Tapping into IPN makes the use of PayPal more professional and reliable for the site itself.

For the second example in the site, I wanted to use a true payment gateway: a system that can be integrated into a site so that the customer never leaves. A secondary, but big, benefit of a payment gateway is that the funds get transferred to the site’s merchant bank account, instead of to a PayPal account. (To be clear, PayPal’s Website Payments Pro works as a payment gateway that can be integrated into a site, but I believe the funds still go into one’s PayPal account.) I’ve used several different gateways over the years, but rarely made the selection myself (normally it’s the client making the choice, based upon their merchant bank account). So I spent some time researching payment gateways to find the one that would be best for the book. Many readers also provided their recommendations (thanks!). Here’s how that search went for me… Continue Reading…

I haven’t been posting much the past couple of weeks because I’ve been working night and day on my “Effortless E-Commerce with PHP and MySQL” book. The deadline for me to turn it all in was August 31st, but I’ve got just a little bit of leeway. I should be wrapping the first draft within the next few days and I’m about halfway through the second draft. To explain…

Basically I write a chapter at a time in Word, passing each along to the editor. The chapters go through a line editor (who looks at word choice, clarity, and style) and a tech editor (who looks at the code and such), then come back to me. At that point I do what’s called an author rewrite (AR), addressing the issues raised by the editors and correcting any thing that I later realized would be a problem (especially on a book like this, where chapters build on each other, it’s common to find when writing Ch 7 that something needs to be said or done in Ch 6). After the AR, the chapter gets turned into a PDF, laid out as it will be in the printed book.

So right now, I’m just about to complete Ch 10 (first draft) and do the AR of Ch 6. The plan is for the book to go to the printer on Sept. 23rd, making it available in stores in October.

In my next couple of posts (soon!), I’ll talk about my selection of Authorize.net as the second payment processor and provide the final table of contents. Thanks to everyone for their interest in the book!

My forthcoming “Effortless E-Commerce with PHP and MySQL” book is now available to read via Safari Books Online. Through the Rough Cuts series, you can read this book as I write it, and even provide feedback that could affect the final text. I just completed Chapter 9, which means there are two more chapters left in the third part of the book. It looks like Part IV of the book will have two chapters as well. I’m hoping to wrap up the first draft of the book over the next two weeks.

For those of you interested in my forthcoming “Effortless E-commerce with PHP and MySQL” book, you can now look at the first example site at http://ecom1.dmcinsights.com. This project is covered in Part II of the book (four chapters total) and demonstrates:

  • Selling access to content (i.e., selling virtual products)
  • User management
  • Content management via administrative pages
  • Using PayPal’s Website Payments Standard system

There are instructions on the site for how you can access it and you can even download all the source code. There’s a form on every page through which you can ask questions or post comments. I welcome any and all feedback you may have!

I’m currently developing the second example site now, and will also make that publicly available when it’s ready. Thanks!