Essential Guide to Dreamweaver CS3: Updates since publication

NOTE: This page is no longer actively maintained. Its original purpose was to keep readers up to date with new developments since the book's publication in July 2007. Corrections to factual errors were hosted on the friends of ED website, which closed in 2011. I have managed to find a copy of the corrections, which are now at the bottom of this page.

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.

Changes to phpMyAdmin 3.0

The user interface for defining new tables in phpMyAdmin has changed in phpMyAdmin 3, which was released in late September 2008. See my blog entry for a list of the differences.

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"?>'; ?>

Corrections

Chapter 17

All the search examples in this chapter use the POST method, which is the default setting in Dreamweaver. Although the examples are completely functional, when building your own search forms you should normally use the GET method and retrieve values from the $_GET array.

p.7

In the final sentence of the penultimate paragraph, the cross reference to "Understanding collation" should be to Chapter 14 (not 13).

p.456

A closing parenthesis is missing at the end of the fourth line of code in step 8. It should read:

if (array_key_exists('send', $_POST)) {

p.493

Step 14 tells you to check your code against register_user_05.php in site_check/ch10. The file is in examples/ch15.

p.515

The 'Creating your own $_SESSION variables from user details' section refers to a file called session_05.php. It ought to refer to success_05.php, which you'll find in the book's downloads.

p.515

In the section titled "Redirecting to a personal page after login", delete both references to $_SESSION[MM_Username], and replace them with $loginUsername. Also delete the highlighted paragraph that begins "Because of the way..." at the foot of the page. (Thanks to banacan for spotting that $_SESSION[MM_Username] isn't defined until later in the Dreamweaver code.)

p.705

The code in steps 9 and 11 was designed to work with short_open_tags turned off in PHP. If your server has short_open_tags turned on (as many hosting companies do), the XML declaration will trigger a parse error. If this happens, move the XML declaration inside the preceding PHP code block, and use echo to output it like this:


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

More about this book

Main book description

Source code (839 KB)

Buy from one of these online stores

Free 7-day trial

Books & Videos by David Powers

PHP SolutionsBeginning CSS3Dreamweaver CS6: Learn by VideoDreamweaver CS5.5: Learn by VideoDreamweaver CS5.5 for MobileDreamweaver CS5 with PHP