The error nobody spotted

… or maybe they were just too polite to say.

I’m currently working on the draft of a new book about PHP, and decided to create a form to demonstrate the effect of the various arithmetic operators. I used the same set of examples that I’ve stuck with ever since Foundation Dreamweaver MX 2004. The example for modulo division is $x % $z, where $x is 20 and $z is 4.5. Since modulo gives you the remainder of a division, the result is obviously 2.

Well, at least that’s what I thought. It’s mathematically correct, so nobody ever questioned it. Imagine my surprise, then, when I fed this example into my form and the result came back as 0. Had I stumbled across a PHP bug? (more…)

6 comments March 8th, 2007

Is XHTML worthwhile?

Let’s me nail my colours to the mast straight away: I use XHTML and have done so for several years. XHTML 1.0 has been a W3C recommendation for seven years (since January 2000). I’m aware of the well-argued objections by Ian Hixie, among others, against sending XHTML as text/html. Opponents of switching to XHTML 1.0 also point out quite rightly that XHTML 2.0 won’t be backwards compatible with previous versions.

So the arguments that break out in online forums from time to time about whether to use XHTML always tend to go over the same ground again and again: XHTML 1.0 isn’t really XHTML because it’s normally delivered using the wrong MIME type (text/html instead of application/xhtml+xml), and anyway everything’s going to change several years down the line when XHTML becomes the standard. My viewpoint has always been this:

  • XHTML 1.0 is an official standard
  • It’s fully supported by modern browsers (even Netscape 4 has no problems with it)
  • Using XHTML 1.0 properly (in other words, making sure that it validates) teaches you the stricter standards that will be necessary when XHTML 2.0 eventually comes along (if it ever does)
  • Well-formed XHTML makes it easier to work with CSS and dynamic code, such as PHP

Of course, you could use the same arguments about valid HTML 4.01. (more…)

6 comments January 2nd, 2007

“PHP Solutions” tops Digital Web’s favourite books of 2006

PHP Solutions has been out for only just over a month, but I’m thrilled to see that Carolyn Wood, Editor of Digital Web Magazine, has put it at the top of her favourite books of 2006. What I find particularly encouraging about her brief comments is that she’s already using some of my “solutions” in her own sites. All too often I find that I pick up a book on web design or technology, and think: “Hmm, that’s interesting”, but then never really do anything with my new-found knowledge. It’s nice to know that I’ve inspired at least one person to try something out.

26 comments December 22nd, 2006

Dreamweaver 8.0.2 PHP hotfix freely available

As a result of lobbying here and in a private forum, the Dreamweaver 8.0.2 PHP hotfix is now freely available for download from this technote on the Adobe website. Thanks to Scott Fegette of Adobe and everyone else for their efforts behind the scenes to bring this about. Please note that the hotfix is needed only if you are using Dreamweaver to develop with PHP. It is required to complete chapters 9 through 12 of my book Foundation PHP for Dreamweaver 8. It fixes the following problems in PHP pages in Dreamweaver 8.0.2:

  • CONCAT() stripped out of SQL queries by Dreamweaver
  • Failure of XSL Transformation server behavior in PHP 5.1.4 and above
  • Backslashes incorrectly inserted when magic quotes are turned off
  • Problems with LIKE in SQL queries

Add comment December 18th, 2006

Getting the Dreamweaver PHP hotfix - some progress

A lot of people have complained (and rightly so) about the way Adobe forces people to jump through seemingly endless hoops in order to get the PHP hotfix that fixes a handful of serious bugs in Dreamweaver 8.0.2. One of the advantages of being an author of books on Dreamweaver is that I can participate in a private forum and raise matters of concern directly with Adobe and the Dreamweaver team. Yesterday, I posted a message in the forum expressing my frustration about the “scandalous lack of availability” of the hotfix, and in the process sparked off a heated debate.

I pointed to the slew of complaints in response to my original blog post. Fortunately, Phil Adkins had reproduced the response he received from Adobe Customer Service. An Adobe representative quickly replied that Phil had got in touch with the wrong department. It wasn’t Customer Service, but Technical Support he should have contacted. Quite frankly, this is nonsense. (more…)

8 comments December 16th, 2006

Tutorial on setting up virtual hosts in Apache 2.2

Changes to the way Apache handles virtual hosts in the 2.2 series affect the instructions for setting up virtual hosts in Windows on pages 86-7 of Foundation PHP for Dreamweaver 8. The most important difference is that Apache 2.2 applies stricter permissions than either the 1.3 or the 2.0 series, so you’re likely to see a “Forbidden” message rather than the website that you were expecting. The other change is that the main configuration file, httpd.conf no longer contains everything under the sun. Virtual hosts and other optional features are now controlled by external files.

I’ve created a tutorial showing how to set up virtual hosts on Apache 2.2 in Windows. Although it was originally intended as an update for my book, I decided to give full instructions, rather than just outline the differences. As a result, the tutorial can be used even if you don’t have a copy of Foundation PHP for Dreamweaver 8. Although why anybody should be without a copy is one of the great mysteries of the universe. ;) (more…)

13 comments December 10th, 2006

Five-star treatment for “PHP Solutions”

Waiting for the first reviews of a new book is always a tense time for an author, so I was delighted to visit Amazon.com today and see not only one, but two reviews that give PHP Solutions five stars. It’s as though Christmas has come early. All I need now is for lots of people to take notice of what one of the reviews says: “this book is a must have”. Although I enjoy writing books, it’s hard work, and the author gets only a tiny portion of the cover price in royalties. Buying through the Amazon links on my site can actually double the amount that I receive for a single copy.

20 comments December 9th, 2006

PHP Windows installer gets major overhaul

For years, one of the big complaints from newcomers to PHP has been the lack of a decent way of automating the installation of PHP on Windows. The Windows installer on the official PHP site was totally inadequate to meet the needs of non-experts. It installed a severely restricted CGI version of PHP that included no extensions and required IIS. The lack of extensions meant that support for MySQL was no longer automatically built into PHP 5, and the requirement for IIS excluded anyone using XP Home. All that has changed with the release of PHP 5.2.0. The Windows installer now offers the full range of extensions and automates most of the configuration on a wide range of web servers. (more…)

11 comments November 3rd, 2006

Revised instructions for online gallery

I have created revised instructions for pages 420-421 of Foundation PHP for Dreamweaver 8 in the Tutorials section of this site. The change was necessitated by the withdrawal of MX Looper as a standalone extension following Adobe’s takeover of InterAKT. The new instructions make use of the very handy PHP Horizontal Looper extension created by Tom Muck. The extension is free, but if you find it useful, you might want to buy the more sophisticated commercial version.

5 comments November 2nd, 2006

MX Kollection 3 free trial no longer available

Adobe’s acquisition of InterAKT on 6 September means that the 30-day free trial of MX Kollection 3 is no longer available. In fact, MX Kollection 3 itself is no longer available. A whole raft of InterAKT products, including the recently released AJAX Toolbox, have been discontinued. MX Kollection 3 and a handful of other products have been repackaged as Kollection, which retails for $399.

As far as readers of Foundation PHP for Dreamweaver 8 are concerned, this affects the final section of Chapter 10 and a couple of pages in Chapter 11. I’ll post more details on the book’s update page when I get chance to write the necessary instructions.

Add comment September 15th, 2006

Next Posts Previous Posts


Categories

Links

Feeds