Home :

Updates since publication

The Essential Guide to Dreamweaver CS3 with CSS, Ajax, and PHP—any misprints or factual errors will be listed on the friends of ED site. This page is intended to keep you up to date with any new developments since the book's original publication (July 2007).

Enabling PHP on Mac OS X Leopard

When Mac OS X 10.5 was released (26 October 2007), the Mac PHP package created by Marc Liyanage that I recommended in the book was not compatible with Leopard. If a compatible version is still not available, follow the detailed instructions for setting up PHP in Leopard in the Tutorials section.

The instructions on pages 113–115 for registering a virtual host in Mac OS X apply only to OS X 10.4 (Tiger). Updated instructions for setting up virtual hosts on Mac OS X 10.5 (Leopard) are in the Tutorials section.

Updating Spry

The official updater for Spry is finally available from Adobe Labs. You need an Adobe ID to download the updater (creating an account is simple and free), which you install like any other extension using the Extension Manager. Using the updater is very straightforward, but I'll post details here of how to use it in the next day or two. The updater does not add any new features to Dreamweaver CS3, apart from code hints and making it easy to bring your Spry library files up to date. Consequently, the instructions in the book remain valid. However, see "Spry 1.6 and HTML" below.

Spry 1.6 and HTML

Spry 1.6 changes the way HTML tags are handled in XML Datasets. As a result, the HTML embedded in CDATA sections in the examples in Chapters 19 & 20 will no longer work as expected if you use Spry 1.6 or later. Fortunately, the fix is very simple.

You can find a detailed explanation of the changes on Spry Labs. In a nutshell, what happens is that Spry converts the angle brackets of HTML tags into their equivalent HTML entities (for example, < becomes &lt;). As a result, you see <p> onscreen, rather than text displayed as a paragraph.

To remedy this, add entityEncodeStrings:false to the options object passed to the function that initializes the data set. For example, in gallery_01.php in Chapter 19, the code that initializes dsPhotos should look like this:

var dsPhotos = new Spry.Data.XMLDataSet("england.xml",
"gallery/photo", {entityEncodeStrings:false});

The preceding example takes only one option, so you add entityEncodeStrings:false on its own between curly braces as the final argument. Where an options object already exists, add it to the existing set of options inside the curly braces. See pages 228–229 for a detailed description of how to pass an options object to the function that initializes a Spry object.

Building XML manually from a recordset

The instructions on pages 703–706 were developed on a server that has short_open_tags turned off in PHP. This prevents the PHP engine from mistakenly treating the <? at the start of the XML declaration as a PHP tag. However, if your server has short_open_tags on (as most hosting companies do), the code as printed in the book triggers a parse error. The solution is to use echo to display the XML declaration. Change the last three lines of code in step 11 on page 705 like this:

header('Expires: -1');
echo '<?xml version="1.0" encoding="utf-8"?>';
?>

Buy from one of these online stores