“PHP for the Web: Visual QuickStart Guide” (4th Edition) 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:

Chapter Page # Description Date Added
6: Control Structures 136 The suggested addition at the end of Step 6 should be:

if ( !isset($_POST['terms'])
OR ($_POST['terms'] != 'Yes') ) {

The wrong clause also erroneously ends up in Scripts 6.6, 6.7, and 6.8 (I say “erroneously” because while it’s a suggested addition, you’re not formally asked to add that code to the scripts).

June 23, 2011
6: Control Structures 144 The sidebar erroneously says that break can be used to exit an if-else conditional. break only applies to loops and switch. April 5, 2012
8: Creating Web Applications 190 The referenced file in Step 1 should be template.html, not layout.html. August 19, 2011
8: Creating Web Applications 216 In the third tip, “selected” erroneously has a hyphen in it. August 28, 2012
8: Creating Web Applications 217 In the second piece of code, there’s an extra apostrophe before “email@example.com”. November 20, 2011
8: Creating Web Applications 230 In the first “review” item, it should be require(), not “required()”. April 3, 2013
9: Cookies and Sessions 243 The first code example is missing a single quotation mark in setcookie(‘cart’, ’82ABC3012′, time()+3600, ”, ‘shop.example.com’, 1); February 3, 2016
9: Cookies and Sessions 254 Not exactly sure what happened in Script 9.8, but the code in the explanation and steps is correct: session_start(), $_SESSION = array(), and session_destroy(). As an added precaution, you can also send a cookie that deletes the session cookie. June 1, 2011
9: Cookies and Sessions 256 In the third “Pursue” prompt, it should say “using the $_POST values” instead of “using the $_GET values” as the form uses the POST method. June 1, 2011
10: Creating Functions 270 There’s an extraneous ‘v’ before htmlspecialchars() in the code under Step 6. July 28, 2011
12: Intro to Databases 344 In the penultimate line of code for Step 2, there’s an extraneous closing parentheses. The corresponding script is correct. April 3, 2013
13: Putting It All Together 394 Step 5 should begin with the inclusion of the database connection script. August 28, 2012
13: Putting It All Together 395 Line 65 of Script 13.7, add_quote.php, should include the footer file, not the header file. The corresponding instruction under Step 12 on page 396 is correct. June 23, 2011
13: Putting It All Together 409 Step 10 has one closing parentheses too many. August 28, 2012
13: Putting It All Together 412 Line 53 of Script 13.11, index.php, should end with a closing paragraph tag. This also applies to the corresponding instruction under Step 13 on page 413. June 23, 2011