Skip to content


“Effortless E-commerce with PHP and MySQL” Update

For the past couple of weeks I’ve been working full-bore on my next book, titled “Effortless E-commerce with PHP and MySQL” (the name has changed slightly since its original), which is why I haven’t been able to post much on the blog. I’m currently working on Chapter 5 , which is the penultimate chapter for the first of the two e-commerce examples being developed. Here’s how the first six chapters are shaping up:

Part 1: Fundamentals

Chapter 1: Getting Started

  • Identifying Your Business Goals
  • Researching Legal Issues
  • Choosing Web Technologies
  • Selecting a Web Host
  • Using a Payment System
  • The Development Process

Chapter 2: Security Fundamentals

  • Security Theory
  • PCI Requirements
  • Server Security
  • Using Secure Transactions
  • Common Vulnerabilities

———————

Part 2: Selling Virtual Products

Chapter 3: First Site: Structure and Design

  • Database Design
  • Server Organization
  • Connecting to the Database
  • The Config File
  • The HTML Template

Chapter 4: User Accounts

  • Defining Helper Functions
  • Registration
  • Logging In
  • Logging Out
  • Managing Passwords
  • Improving the Security

Chapter 5: Managing Site Content

  • Creating an Administrator
  • Adding Pages
  • Displaying Page Content
  • Adding PDFs
  • Displaying PDF Content
  • Recommended Alterations

Chapter 6: Using PayPal

———————

Chapter 1 is an overview of the process along with tips for making certain decisions, such as hosting. Chapter 2 is generally a big-picture look at security, along with what primary decisions (e.g., hosting, certificate types) you’ll need to make. At the end of the chapter, I discuss the most common server vulnerabilities and attacks and how you go about preventing those. Although the chapter is really about an approach to security, it has some exact recommendations as well. More specific security techniques are demonstrated throughout the rest of the book.

In Chapters 3-6, you’re creating a entire site for selling access to online content, in both HTML and PDF formats. You’ll learn some ways to automate processes and effectively separate out bits of code to make the site easy to maintain. I don’t do anything fancy with the HTML templates, the PHP, or the MySQL, but there’s some great application of those technologies (in other words, you’ll learn a lot but won’t be overwhelmed with stuff like Smarty, OOP, etc.).

In Chapter 4 I created some really great helper functions. I even impressed myself with their usefulness and simplicity. The chapter also handles passwords and form validation in very secure ways. Chapter 4 concludes with some other ways you can heighten the security of the system, when you deem that appropriate. Chapter 4, User Accounts, may be something you’re familiar with overall (perhaps from another book of mine), but I think I’ve added enough new ideas here to still give you some value for reading it.

In Chapter 5 you learn how to add content to the site. There are two types. For the first, you can add HTML content using a WYSIWYG editor, that I show you how to integrate. For the second, you can upload PDFs. The PDFs will only be served through a proxy script so that a user must be logged in (with an account that hasn’t expired) to access them. The chapter wraps with discussions of about six different features you could add to the site, almost all intended to make it a better site for the potential customers. Although I don’t walk through the every add-on in complete detail, you’ll see what other tables you’d need to create, what SQL commands might be involved, and how the PHP code would work. I like this addition to the chapter and hope you will, too.

Chapter 6 integrates PayPal. You’ll learn a bit about how PayPal works and what its strengths and weaknesses are. Then you’ll use PayPal’s sandbox to test your site and see what you need to do to take the site live.

Next week I’ll be starting on Part 3 of the book, in which you’ll create an online site that sells coffee (beans, not brewed). I choose coffee as a product for a couple of reasons. First, I love coffee. Second, it’s an example of a physical product that must be shipped, that has inventory, and that also has permutations–size, roast, whole beans/ground–without being too, too complicated.

So that’s where things stand. Thanks for your interest in the book and please share any questions and comments you may have!

Posted in MySQL, PHP, Web Development.

Tagged with , , .


6 Responses

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Jason says

    I like the name change, fits in with another great book I know of that covers Flex ;)

    So for the first project it allows customers to register and purchase e-products using paypal?
    Are the products downloadable or is the user given access to view the PDFs only? If so, for what period of time do they have access to the product?
    What sort of order management will be available?

    I’m very interested in the e-products example because I’ve been toying with the idea of e-learning, which is giving people access to content based on a subscription.

    Will you be handling recurring payments with PayPal?, that’s definitely something I have never done.

    • Larry says

      Hey Jason,

      Thanks for the comments. Yes, my editor thinks I should run with the “effortless” brand, so expect to see many more titles like that (e.g., “Effortless Napping”, “Effortless Ennui”,…).

      Yes, in the first example, users have to register, then go to PayPal to pay a yearly subscription fee. Then they have to login to see the content. If user’s aren’t logged in, or if their account has expired, they’ll see a description of the content and a note to register or renew their account. The e-products are HTML pages and PDFs. They can access that content for as long as their account is good. The intent is for viewers to look at the content through the site; there’s no way to keep the user from downloading the content. There’s no order management involved; customers are just buying access.

      I will be talking about the recurring payment option in PayPal, although I don’t know to what degree. I’m hoping to put this example online next week to get feedback from people. When I do I’ll send the URL in a newsletter. And you’ll be able to download the code to check it out.

      Thanks again!
      Larry

  2. Jack Sanderland says

    Hi Larry,

    I just can’t wait to buy the new book in october. I have all your precious PHP/MySQL books in all editions which I have read over and over in the past decade. As a computer technician known as the “toner guy” at my work I slowly became the main programmer for our intranet (schedules, pay roll, HR app etc.) At the stage I am at, the content of this new book is exactly what I am looking for. Thanks.

    • Larry says

      Big thanks for your interest in the book. I haven’t been posting much lately because I’m working night and day on it, but I’m down to the last couple of chapters. I’ll post some more updates soon. Congrats on how your job has expanded (although I’m now worried about who’s managing the toner). It sounds like your job gives you the opportunity to learn new things and experiment, which is so great. Thanks again!

  3. Alan V says

    Hi Larry,

    Do you have a more concrete idea of when the book will be released? Also, how’s the Javascript book coming along?

    Thanks again for all your books!

    • Larry says

      Thanks for your interest in the books and for the questions. I don’t know more specifically when the book will be available. I would think the end of October, but I could be wrong. I haven’t done any work on the JavaScript book (because I’ve been doing this other one), but I’m hoping to get going on that again soon. I’ve just acquired a new writing tool (piece of software called Scrivener) that I hope will help. I’ll post updates when I have them!

If you need quick assistance with a question or problem related to one of my books, please use the support forums instead.

Some HTML is OK

or, reply to this post via trackback.