Author: Robin Nixon
Format: Paperback, 526 pages
Publisher: O'Reilly Media, Inc.; 1st edition (July 22, 2009)
Unless you've been hiding in a cave for the past ten years or so, you know that it takes more than a bit of HTML slight-of-hand to make a modern, dynamic website. The (so-called) Web 2.0 is constructed of a mix of technologies, creatively applied to allow the interactivity we have become accustomed to when surfing the web. Just looking at the front and back covers of Robin Nixon's book, he (and O'Reilly) promises to teach the reader all of the technologies (though I see no mention of CSS) required to bring your Web 2.0 creation to life, and send it out on the Internet. The best bit of news is that, according to the back cover blurb, "No previous programming experience is required." Really? We'll see.
The first chapter is all high level concept regarding the nature of HTTP, and the various technologies headlining the book. Apache in specific, and open source in general also are included. Nixon seems to be setting the stage here for further learning to take place. The chapter is short, and ends modestly with a few simple questions for chapter review. The answers to these, and all the questions posed in subsequent chapters, can be found in Appendix A. This is a "good/bad" thing. It's good in that, if the reader gets stuck, he or she can pop back to the appendix, or just check to see if the answers they gave are correct. It's a "bad" thing in that, sometimes people get stuck quickly and, rather than trying to figure out the solution, will cut to the chase and head for the answer section. Generating effort to find an answer is how most people, especially me, learn. That said, it's better to provide confirmation, rather than have the student never know for sure.
To set up a website, you need a server. In this case, the server needs to be capable of providing basic web services, database services, and PHP. Enter LAMP (or WAMP if you're a Windows person). Setting up a basic LAMP (Linux, Apache, MySQL, PHP) or XAMPP server is ridiculously easy, as the apachefriends.org site illustrates. The book uses other resources, such as easyphp.org, if you need to set up WAMP on Windows. MAMP is also available for Mac OS X people, so no one is left out of the loop based on OS of choice. So far, there's a significant amount of hand holding going on. What happens when the reader has to get their hands dirty with an actual programming language, such as PHP?
Hello world. Yes, this time-honored method of beginning to teach a programming language is introduced on page 34. The book's companion website hosts all the sample code used in the book. Just go to lpmj.net and then click on "Examples" to download the zip file. The site's table of contents also lets you select a chapter and section, to view sample code, if you don't want to refer to the downloaded files. Nixon faces the challenge of teaching both basic programming skills and PHP reasonably well. A programmer at my "day job" recently created the analogy of an array being like a series of shoe boxes. Page 40 compares arrays to a series of matchboxes, which is more or less the same thing. I mention this to draw out the teaching style used here. Learning a language is one thing, but you won't learn it well unless you understand why things work as they do. Besides, the goal isn't just to learn programming, but to learn it in the service of creating a "dynamic website".
There are five chapters that immerse the reader in PHP, before switching gears and moving to MySQL. Again, LAMP/WAMP/MAMP/XAMPP provides a handy "safety net" for the reader in managing everything and keeping it all in one container, but there's still a lot to learn. The last PHP chapter is a nice set up for the introductory MySQL chapter. Just when you think you're making some progress with PHP, you're sent back to "kindergarten" and the basics of relational databases (and as an aside, if the idea of databases is just too intimidating for you, check out The Manga Guide to Databases, which I also reviewed).
Assuming you make it all the way through, and actually learn everything that's being taught, you'll be able to put together a relatively modest, interactive website, just using this book. No, you're not an expert, but you should be feeling a sense of accomplishment by now. The "Robin's Nest" website example used looks pretty vanilla flavored. I guess you'll still need to go out and pick up CSS to add some spice.
In addition to the end of chapter questions being answered in Appendix A, Appendix B lists various online resources to consult, but that's all...it's just a set of lists of URL, but fun to explore. Appendix C and D cover MySQL FULLTEXT Stopwords and MySQL Functions respectively. My guess is that, you'll probably have started consulting external resources on dynamic website construction long before you finished this book which again, makes sense, though the book is quite self contained.