Archives For book

In this edition…

About This Newsletter

So it’s been about six weeks since my last newsletter, or roughly twice as long as I normally hope I get these things out. The cause for the delay is simple: I’ve been working night and day on my forthcoming “Effortless E-Commerce with PHP and MySQL” book, trying to make the end-of-this-month deadline. I don’t think I will, but it’ll be close. Anyway, this newsletter has some stuff about that book that you may be interested in, along with a couple of other notable things I’ve found online. I went looking for some good questions to answer in this newsletter, but didn’t have any set aside, so if you’ve got a question you’d like me to answer in a future newsletter, including one you’ve previously submitted but I apparently ignored, please send it along. As always, thanks for reading and for your interest in my work!

On the Web => First Example Site for “Effortless E-Commerce with PHP and MySQL”

My “Effortless E-Commerce with PHP and MySQL” book has four parts to it. In the first part, there are two chapters of general information: one on the process and another on security. In the second part, I develop an entire e-commerce site. In the third, I develop a second e-commerce site. In the fourth, I discuss and demonstrate additions you could make to both sites. My original intention was to get all the code done (at least for Parts 2 & 3), and then start writing. As with all good plans, this is not how things went. But I’m happy to say that the first example site is complete, as are the first six chapters of the book (the first draft of those chapter, that is).

If you’re interested in the example I came up with, you can check it out online at http://ecom1.dmcinsights.com. This is a fully functioning, live version of the site, complete with registration, login, password management, content managment, and PayPal integration. The PayPal integration is currently done using PayPal’s Sandbox (i.e., their test system), so you can even pretend to pay for site access.You can also download the source code for the site, if you’d like to get a look at what the book will discuss. The source code is fairly well documented, so you should be able to get a sense of what I’m thinking through that.

On each page of the online site (this isn’t in the book) is a comments form for you to raise questions, make suggestions, and so forth. I would love to get as much feedback and as many points of view as possible. I’ll also give away a few copies of the book specifically to people who’ve submitted commments.

I’m working on the second site example now (well, as soon as I send this newsletter out) and will make that available when it’s ready.

On the Web => Rasmus Lerdorf’s No-Framework PHP MVC Framework

Some years ago, Rasmus Lerdorf, original creator of PHP, posted on his personal Web site a discussion of what he would look for in a framework for the MVC architecture. It’s an interesting read, from the master’s voice. He specifically talks about how to properly use MVC, how to guarantee performance and security, and how to design with scalability and flexibility in mind. Although the post is a few years old, most of it is still valid, with only little changes such as the fact that the PECL/Filter extension is now part of PHP proper.

On the Web => ServInt: Customer Service Done Right!

I’ve been using ServInt for my Web hosting for some time now (three years, I think) and could not be happier. In the past eleven years, I’ve probably had five hosts, ranging from the really cheap and totally awful to the not-that-cheap but still rather awful. For me, finding a Web host that I can rely on has been a huge weight off my shoulders. One thing ServInt does right is that they only do high-end hosting, starting with VPS (Virtual Private Server) and going up to dedicated hosting. What they don’t do is put 50 clients and hundreds of domains on a single server, which is what the cheap hosts do. Don’t get me wrong: cheap hosting is fine for many people, especially with small projects and new ones, and in many cases spending only a few dollars a month makes sense. If you’re just learning Web development today, you should probably start with a cheap host.

By comparison, I’m using the most basic ServInt plan and it’s running me $50/month (US). But, again, that peace of mind… The other thing that ServInt does right, which is the bigger deal, is their customer service. They respond immediately to concerns of mine and often help out on things that aren’t really their problem (i.e., when I screw up). Moreover, ServInt has just, for at least the second or third time since I’ve been with them, opted to provide more services at no additional cost. I received an email a few weeks back indicating that my basic account has been upgraded from 30GB of storage to 50GB (which, frankly, I needed, as I was at about 28GB and thinking I’d need to start weeding through my drives). ServInt has previously upgraded the storage before, as well as the RAM and bandwidth allotments, so this isn’t entirely surprising but is still a fantastic thing to see.

I’m not writing this in order to sell you on ServInt (although I can definitely recommend them in good conscience) but rather to highlight an example of excellent customer service. Good customer service properly fixes problems when they arise. Great customer service does so nicely, promptly, and with a little extra. Excellent customer service prevents problems from happening in the first place and provides extra services at no additional cost. I’m not a marketing guy by nature, but I know that ServInt has my business for the long run because of things like this. And just as I’m writing this, I’m thinking that if times were tight financially, if I had a little extra free time, and if I was looking to improve my business, I might go back to some of my clients and offer something for free, too, such as doing a bit of software upgrading or adding a feature they wanted but couldn’t afford. I’m sure that’d make an impression and generate more business in the long run. Once they accepted that you weren’t trying to scam them, that is!

On the Web => Geek Humor

I came across this cartoon, which is funny in a geek-y way, and thought I’d share: http://xkcd.com/327/

On the Blog => Yii-related How-To’s

I wrapped up my fourth Yii-based site a couple weeks back (although I’m still making minor tweaks per the client’s requests) and I’ve been doing some consulting for a client that’s learning to use Yii for his projects, so a number of my blog posts as of late have been about Yii. If you look under the Yii tag at my blog, you’ll see articles on:

  • Handling Related Models in Yii Forms
  • Handling Checkboxes in Yii with non-Boolean Values
  • Forcing Login for All Pages in Yii
  • Caching the Database Schema using MemCached with Yii

These are just the most recent articles I’ve written on Yii. There are some older ones about authorization and authentication, plus my original eight-part series on learning Yii. Perhaps next year, depending upon how my experience in self-publishing a JavaScript book goes, I’ll self-publish a guide to Yii, as I’ll have informally written a book on the subject by then!

On the Blog => “Effortless E-Commerce with PHP and MySQL” Updates

I recently published an update on my “Effortless E-Commerce with PHP and MySQL” book. The update reflects the actual Table of Contents for the first five chapters of the book, based upon the rough draft of them. You can also learn a bit about the content of each. I’ll probably post another update in about two weeks.

What is Larry Thinking? => Teaching, Not Selling

My blog has gotten a lot of attention over the past several months because of my series on the Yii-framework (on the Yii’s documentation page, the first link for learning Yii is to my series). I’m glad people like what I’ve written and feel like it’s a good way to learn, as it makes the work I put into the blog meaningful. However, I’ve been surprised to get a percentage of questions along the lines of “Why should I use Yii?”, even though that is a resonable question. But I also get the less reasonable “Why should I switch to Yii from XXX framework?” or just “I can already do these things much more easily using XXX.”

Asking about the benefits, which is also to say the strengths, of any new technology is natural. As a person writing about certain technologies, I feel that it’s part of my job to cover this side of things. But there’s a line between teaching and selling that I don’t cross: it’s never my goal to talk someone into using X or Y; my only aim is, if you want to learn X or Y, to make that learning process smoother. I have opinions about Yii and jQuery and Ruby/Flex/AIR/Mac OS X/PHP/MySQL/just-about-everything but I don’t care whether people do or do not use any particular technology (and I don’t mean that to sound harsh). What I do care about is, if they are trying to learn X using my writing, that my writing is helpful in that regard. In short, there’s a large part of who I am that’s a teacher, but I don’t have a selling bone in my body.

So the answer to a question about using Yii, or using Yii instead of, say, Zend, is that I think Yii’s approach makes sense to me, I like that it autogenerates code for you, jQuery is built-in, and that Yii is easily extendible. My answer to a question about why someone should switch to Yii is I don’t know and/or maybe you shouldn’t. I think people in this industry get hung up on what’s best or, even worse, what’s hip or new (“Web 2.0”? Ugh!). Or they feel like the announcement of or praise for something different is in some way an affront to what they’re currently doing. This is all immaterial. At the end of the day, the only question that really matters is: does this work for you? And that’s a question I can never answer, except to say “Maybe give it a whirl and see for yourself.”

Book Giveaway=> “Effortless Flex 4 Development” Update

There was a great response to my “Effortless Flex 4 Development” giveaway and I think I made many people happy with the free copies they got. Everyone should have received their book by now (actually, a couple of weeks ago), so let me know if you didn’t get yours. I have a couple more copies left that I’ll give away in a future newsletter.

Larry Ullman’s Book News => “Effortless E-Commerce with PHP and MySQL”

As you can tell, pretty much all of my time these days is being spent on the “Effortless E-Commerce with PHP and MySQL” book, which is coming along nicely. After doing recent books on Flex, Ruby, and Adobe AIR, it’s nice to get back to my programming roots. And as people have been requesting this book for years, and as I should have written it last year, it’s great to get this done. My hope is to wrap up the rough draft in very early September, meaning the book should be out in October. The book will also be put online via Peachpit’s Rough Cuts series, and I’ll post that URL once I know it.

I received a lot of interest, in response to my previous newsletter, about my planned self-published JavaScript book. I’m happy to see such interest, because it’s going to be a lot of work! Many people also volunteered to help proofread the text and test the code, which is wonderful and extremely generous. One thing I’ve learned writing books all these years is that having more people look at the book makes it better. It’s not a case of “too many cooks spoil the broth”, it’s more a matter of lots of tasters provide great feedback!

I’m also talking to Peachpit Press about doing the fourth editions of my “Dynamic Web Sites with PHP and MySQL: Visual QuickStart Guide” and “PHP for the Web: Visual QuickStart Guide” books. Both will be published in 2011, updated for the latest versions of PHP and MySQL (and dropping the PHP 6 moniker, which is thoroughly dead in the water). Per repeated requests, I’m also going to integrate a page or two of questions, suggestions, and exercises at the end of each chapter. Right now, it looks like I’ll write the fourth edition of “PHP for the Web: Visual QuickStart Guide” this fall, so that it’s published in early 2011.

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!

I am very pleased to announce that my latest book, “Effortless Flex 4 Development”, came out today. Well, kind of. I received my copies today, which means that the book does exist in physical format, although it may be a couple/few days before it’s on bookshelves. Amazon has it listed as being available on July 5, 2010 and currently sells it for $29.69 (the MSRP is $44.99). I will also be giving away a few copies to people subscribed to my newsletter.

As always, my thanks to those interested in my work!

I am very pleased to say that I’ve just finished the rough draft of the Table of Contents for my forthcoming “E-Commerce with PHP and MySQL” book, to be published by New Riders Fall 2010. I’ve been wanting to do this book for some time (and was supposed to do it last year) and readers have been asking for it for even longer, so I’m really excited to get going on it finally. Continue Reading…

Peachpit Press, publisher of my forthcoming “Effortless Flex 4 Development” book, has published another excerpt of the book online, free for anyone to read. (Technically New Riders is the publisher, but New Riders is owned by Peachpit.) This article represents a few pages from Chapter 4 of the book, “Event Management”. It follows the previous excerpt (also from Chapter 4), which you should probably read first if you haven’t. The first excerpt largely discusses event handling theory; in this excerpt you’ll see how to turn that theory into actual code. Even if you don’t yet know Flex and ActionScript, you should still be able to follow along. Most importantly, Flex is largely an event-driven approach to application development (conversely, Flash Professional is primarily a timeline-driven approach), so this section is really a key insight into what it’s like to use Flex.

I’m just about to do two “5 Tips in 5 Days” blog posts for Peachpit’s site. One will be specifically on the Flex 4 framework and the other will be on Flash Builder. Flash Builder, in case you’re not familiar with it, used to be called Flex Builder and is just a commercial IDE for developing using Flex. You don’t have to use Flash Builder as the Flex 4 framework and its SDK are available for free, but it does ease the process significantly. The book does not assume you’re using Flash Builder, either. There are specific instructions for how to create Flex applications using a text editor and the command-line IDE, but there are also areas that cover how you would do X or Y using Flash Builder. Most of the book focuses on the Flex framework, so it doesn’t matter what development tools you’re using.