Skip to content


“PHP for the World Wide Web: Visual QuickStart Guide” Errata

Unfortunately, despite the best efforts of myself, the technical editor, the copy editor, the line editor, the proofreader, and despite the multiple revisions, errors still occur. This page lists all the errors found in the book since it went to print.

Note: errors are corrected in subsequent printings and therefore your particular copy may not contain all of the following. You may also be experiencing problems not caused by a mistake in the book. If so, you may find the solution to your problem by using the book’s corresponding forum. Significant changes in the technology will be addressed there and you can also find problems and solutions encountered by other readers.

Known Errors in the Book:

Click on a column heading to sort the table by that column.

ChapterPage #DescriptionDate Added
Introduction0On page xvii, Chapter 14, Debugging is inadvertently referred to as Chapter 15, Debugging.July 10, 2001
1: Getting Started2The second Tip should begin (change in italics) You can also check with your ISP to see.June 10, 2001
1: Getting Started8It states that printf() would be discussed in Chapter 13. It is actually discussed much earlier in the book–in Chapter 4, Using Numbers (pages 43-44).February 3, 2002
2: Variables22In the last full paragraph, curly quotes are used instead of straight quotes.February 9, 2003
2: Variables24Chapter 7, “Using Arrays”, is inadvertently referred to as Chapter 6.January 1, 2004
3: HTML Forms and PHP32Figure 3.2 does not end with a closing HTML tag.September 24, 2003
3: HTML Forms and PHP33Scripts 3.4, 3.5, and 3.6 are missing the opening and closing parentheses in the print() statements. While this is technically acceptable, it does break with the conventions of the book.
3: HTML Forms and PHP33In Script 3.4, Script 3.5 and Script 3.6 (pages 33, 35, and 37), the closing </HEAD> is missing. The downloadable versions of the scripts have been updated accordingly.
3: HTML Forms and PHP33Script 3.4 and many others in the book require that register_globals be turned on. For more information, see this posting.May 1, 2003
4: Using Numbers45In the last Tip, the code should read $Number–;.
4: Using Numbers45The last line of the first paragraph should read use “++” or “–” accordingly (the two minus signs were fused by the printer).July 10, 2001
4: Using Numbers45The line change line 10 of script 4.3 to read $tax++; should read change line 11….December 31, 2001
4: Using Numbers45In Script 4.3, line 6 is missing the inital opening bracket. The line should be
<?php
March 25, 2002
4: Using Numbers48It should be explained that the round() function can only take a second argument to round to a particular decimal point in PHP 4. Line 14 of Script 4.5 will cause an error in earlier versions of PHP.
5: Using Strings52Script 5.1 is missing the opening and closing parentheses in the print() statements. While this is technically acceptable, it does break with the conventions of the book.
5: Using Strings52The closing </HEAD> tags in Script 5.1 through Script 5.7 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
5: Using Strings54The first line of code should end with a semi-colon and not a period. It should read:
$NewString = $aString . $bString;
May 25, 2001
5: Using Strings57On page 57, the caption of Figure 5.14 should conclude with into its ASCII equivalent, %27.July 10, 2001
5: Using Strings63Towards the bottom of the page, the text inadvertenly says
$StringLength = strelen($String);
whereas it should say
$StringLength = strlen($String);
strlen is misspelled.
5: Using Strings64The caption to Script 5.7 should end All in 16 lines!.May 25, 2001
5: Using Strings64The paragraph starting md5() is similar is use, should say is similar in use. That sentence also ends with an extraneous period.August 21, 2001
6: Control Structures69The last sentence begins In order words… but it should read In other words… (naturally).August 21, 2001
6: Control Structures71In the first paragraph, the symbol for decrementing a number should read as two separate hyphens put together as in .May 25, 2001
6: Control Structures73Step 4 says that the discount will only be applied if the $TotalCost value is lesser than or equal to $50. It should be if the $TotalCost is greater than or equal $50.August 21, 2001
6: Control Structures75Script 6.4 is missing the word discount on line 16. The text in the corresponding step is correct.July 31, 2001
6: Control Structures77The numbering of the steps inadvertantly begins with 2 instead of 1.May 25, 2001
6: Control Structures79The closing </HEAD> tags in Script 6.6 and in Script 6.8 through Script 6.10 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
6: Control Structures81In the third tip, the second statements line should read statement(s)2;.May 25, 2001
6: Control Structures84In creating Script 6.8 on line 16, and on page 85, under step 11, an
extraneous v character has been appended to the
<BR> just before the ending parenthesis.
6: Control Structures85Script 6.8, the backslash needed to escape the quotation mark for the word email is missing on line 26. The corresponding step instruction is correct.August 21, 2001
6: Control Structures93Script 6.10 actually returns non-prime numbers, if they are multiples of primes other than 2, 3, and 5 (e.g., 49). To correct this, you would need to add an array which records every prime and each new $n would be compared against this entire array.
6: Control Structures94I have no idea why, but 7 modulus 5 is listed as .4 when it’s really 2. Extreme mental lapse…May 7, 2003
7: Using Arrays96At the end of the second full paragraph, it should read …stored at a particular point….July 12, 2003
7: Using Arrays97The closing </HEAD> tags in Script 7.1 through Script 7.5, Script 7.7and Script 7.9 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
7: Using Arrays102In step 6, the script fragment ?></body></html> is missing.July 10, 2001
7: Using Arrays105The text of step 7 should be printed as part of step 6.May 25, 2001
7: Using Arrays106Step 1 should read Open your text editor and create a new PHP document.May 25, 2001
7: Using Arrays108The text of step 11 should be printed as part of step 10.May 25, 2001
7: Using Arrays113In the caption to Script 7.8, it should read You don’t even have to specify keys for each field… not for each array.May 25, 2001
8: Regular Expressions121Table 8.1 (pages 121 and 266) is missing the * character which matches zero or more occurences, as it is written in the text itself.July 20, 2001
8: Regular Expressions123The closing </HEAD> tags in Script 8.2, Script 8.3, and Script 8.5 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
8: Regular Expressions127The last line of the second paragraph should read:
“[a-z]{3}” would match abc, def, etc..
8: Regular Expressions128The second pattern (testing en e-mail address) is missing the ending space before the final quote (as explained in the second paragraph of page 129.
8: Regular Expressions131The text for step 7 should really be printed as part of step 6.May 25, 2001
9: Creating Functions135The closing </HEAD> tags in Script 9.1 through Script 9.4 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
9: Creating Functions139In Script 9.4 and in the corresponding instructions, the second morning shoud be afternoon.September 24, 2002
9: Creating Functions140The last tip should read (changes indicated by italics): Technically if you pass a number as an argument in a function, it does not need to be within quotation marks but there is no harm in using quotes anyway to remain consistant as to how arguments are passed.May 25, 2001
9: Creating Functions148Scripts 9.7 and 9.8 contain extra spaces after the word widget(s). This is nitpicking, but it did annoy the author when he discovered it!
9: Creating Functions149Under step 5, the final paragraph should begin (change in italics) To demonstrate that the global statement and not To demonstrate that the global variable ….May 26, 2001
9: Creating Functions152Under step 5, the line of code should read:
print (CalculatePayments ($TotalCost));
as it is in the corresponding script (one closing parenthesis is missing).
May 26, 2001
10: Files and Directories156Figure 10.1 is repeated as Figure 10.2. Figure 10.3 should actually be Figure 10.2 and the real Figure 10.3 is missing. Click here to view the real Figure 10.3.
10: Files and Directories159Script 10.1 is missing the closing HTML tag. While the page will still function properly, it does constitute poor form.
10: Files and Directories160Scripts 10.3 and 10.6 are missing the php portion of the initial PHP tag. These scripts will still function properly if short tags are acceptable in your PHP configuration.
10: Files and Directories160The closing </HEAD> tags in Script 10.3 and Script 10.6 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
10: Files and Directories170In Script 10.6, the comment on line 10 mistakingly states that the WriteToFile function takes URL and Description as its arguments. It actually takes Username and Password. While this won’t affect the execution of the script, it has been changed in the downloadable versions available online.June 13, 2001
10: Files and Directories170In step 12 contains an extra srand(mktime()); which should not be there. The corresponding Script 10.6 is correct.July 26, 2001
10: Files and Directories170Script 10.6 has quote marks around the permisions for the mkdir() command. These quotes seem to cause problems on some systems. If you are experiencing difficulty with this aspect of this script, remove the quotation marks.August 14, 2001
10: Files and Directories182The last sentence of the caption to Figure 10.16 should read (addition in italics) Checkboxes are displayed giving the user the option of deleting, renaming, and uploading files.May 26, 2001
11: Databases186The closing </HEAD> tags in Script 11.1, Script 11.2, Script 11.4, and Script 11.5 are missing. While this will not affect the execution of the script, they have been changed in the downloadable versions.July 10, 2001
11: Databases187The images in Chapter 11 are off. First, Figure 11.2 should be similar to that in Figure 11.4. Figure 11.3 should be a simple “The database, NewDatabase, could not be created!” message. Finally, the images printed as Figures 11.2 and 11.3 actually belong with the script running from pages 193-196. Ugh.July 9, 2001
11: Databases199On page 199, under step number 4, the line
$Result = mysql_db_query ($Query, $Link);
should read
$Result = mysql_db_query ($DBName, $Query, $Link);

as it does in the corresponding script (Script 11.5).

12: Cookies204Scripts 12.1, 12.2 and 12.3 are missing the php portion of the initial PHP tag. These scripts will still function properly if short tags are acceptable in your PHP configuration.
12: Cookies204Script 12.1 is missing the opening <HEAD> and <BODY> tags. This also applies to step 5 on page 205.March 19, 2003
12: Cookies208In Script 12.2, the opening <HTML> tag is missing.June 8, 2002
13: Creating Web Applications215In Script 13.1, the closing </ TR> on line 11 (and also in Step 4) is missing it’s slash.April 15, 2002
13: Creating Web Applications229Script 13.9 is missing the php portion of the initial PHP tag. This script will still function properly if short tags are acceptable in your PHP configuration.
14: Debugging238Scripts 14.3 and 14.4 are missing the php portion of the initial PHP tag. These scripts will still function properly if short tags are acceptable in your PHP configuration.
14: Debugging243In steps 5 and 6, the slashes before the header() lines which would indicate that they are commented out are missing. The corresponding script is correct, however.July 10, 2001
14: Debugging245The closing </HEAD> tag in Script 14.6 is missing. While this will not affect the execution of the script, it has been changed in the downloadable version.July 10, 2001
Appendix A: Installation251There are a couple of errors. The first is that the printer fused two dashes (–) into one. Thus, in steps 5 and 7, the code –with-apache, –enable-track-vars and –activate-module should all begin with two dashes. Secondarily, the code in step 7 should read:

cd ../apache_1.3.14 ./configure –activate-module=src/modules/php4/libphp4.a
(The ‘s’ is missing after module=.)

April 6, 2002
Appendix A: Installation251In step 4, two hyphens are fused into one em dash. The code should read cd ../apache_1.3.14 ./configure –prefix=/www.August 17, 2003
Appendix C: PHP Resources266The first line of Table C.1 should read ! ++ – (again, the two minus signs were fused together).

No Responses (yet)

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

If you need quick assistance with a question or problem related to one of my books, please use the support forums instead.

Some HTML is OK

or, reply to this post via trackback.