Computer Bookshelf

PHP Web Development with Dreamweaver MX 2004

Allan Kent and David Powers with Rachel Andrew

Apress, June 2004

Book cover This is my second foray into writing about creating database-driven websites using PHP/MySQL and Dreamweaver. Like my earlier book (Foundation Dreamweaver MX 2004, published by friends of ED), this book assumes no previous knowledge of either PHP or MySQL. Where it differs is that we assume readers already know the basics of building a static website, so we can concentrate on the main subject - putting PHP to work.

Allan Kent kicks off the book with three chapters offering a broad overview of the three main technologies being used: PHP, MySQL and Dreamweaver MX 2004. Then Rachel Andrew of the Web Standards Project takes an in-depth look at designing with web standards, something made considerably easier by many of the improvements in the latest version of Dreamweaver. Using CSS and valid XHTML is not just a fad as far as dynamic websites are concerned; it's a necessity. Server-side languages like PHP are very fussy about correct coding. One comma or quote out of place, and your website can come crashing down like a pack of cards. Yes, you can build a PHP website without CSS or a valid doctype, but it makes your life a lot harder, and any time "saved" by using outdated methods is usually lost many times over in increased site maintenance.

Then it's down to business, building database-driven pages. Allan looks at the various server behaviors built into Dreamweaver MX 2004 that make this process much simpler. I follow up with a detailed look at code reuse, utilizing Dreamweaver templates and library items, but most importantly building your own code library and creating your own custom-built functions in PHP. I take a hard look at the pros and cons of templates, and compare them with PHP includes, a subject that can be difficult for beginners to grasp, but which offers considerable benefits - and which Dreamweaver, incidentally, makes a lot easier to implement. Allan then offers advice on other Dreamweaver time-saving devices - extensions, telling you not only how to install those created by others, but also showing you how to build your own. It's not as difficult as it sounds! My second chapter deals with the less glamorous, but nevertheless essential subject of what to do when things go wrong - not only error detection and troubleshooting, but plenty of tips on how to avoid errors in the first place.

Finally, the crowning glory of the book (well, I think so, because I wrote it!) - a really detailed case study, looking at how a real-life content management system is put together. It's a mini-book in itself (120 pages long), showing how to plan the database tables, and building the administrative back-end with solid procedures to ensure that only valid content is entered into the database. In the process, you build several new server behaviors that can be used again and again in different sites. When putting the front-end together, I look at some advanced SQL queries drawing information from four separate tables. The finished site could be used as the basis for a club, an online product catalogue, or a personal blog.