
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.
| 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 | 217 | In the second piece of code, there’s an extra apostrophe before “email@example.com”. | November 20, 2011 |
| 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 |
| 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 | 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 |

ebook, chapter 6, page 136 it states: “To
be more exact, this conditional could be
if ( !isset($_POST['terms']) AND
➝ ($_POST['terms'] == ‘Yes’) ) {
Only one “=” makes it work.
Hello Arlene,
Thanks for your suggestion. Using only one = would be a mistake, as that’s the assignment operator, not the equality operator. It will “work” in the sense of being true, but not “work” in the sense of actually test the condition. I suspect there’s a problem with your form.
K… I was getting an error for that line, and it worked fine once I changed it to just “=”. I just figured it was the code, but I’ll look at my form to make sure. Thanks.
I can’t find the error in my form yet. I didn’t get any errors with the original statement (before replacing it with the “and” statement), and it worked fine. It works perfectly without the 2nd “=” too, whether I check off the box or not, I get the appropriate responses — but not when I have both “==”. Odd.
But of course, I trust you more than myself since I’m just learning this stuff. LOL Well, re-learning this for the 2nd time. I didn’t stick with it after finishing the 3rd edition and ended up forgetting just about everything.
I’ll keep looking.
Hello Arlene,
If you’re curious about this and want help, please turn to the support forum. Keep in mind, however, that it does not work “perfectly” without the second equals sign. If you only use one equals sign, you’re doing something other than checking for equality. In other words, you’re introducing a bug into the code.
I just might have to do that. I can’t find the error, but I took a 24 hour break from it so hopefully that will help. Thanks for the feedback/responses (quick too).
In Chapter 10 (Creating Functions) of PHP for the Web: Visual Quick Start Guide [Fourth Edition], page 270, step 6, there is a mistake in the code. I quote directly from the book:
if (isset($_POST[$name])) {
print ‘ value=”‘ . vhtmlspecialchars($_POST[$name]) . ‘”‘;
}
I have removed the breaks that are in the book so that the code fits nicely within the column margin, (which are unnecessary here), in order to make the code easily readable.
As you may have already noticed, the function vhtmlspecialchars() does not exist. I think it is a mispelling of the function htmlspecialchars().
It has no real importance but I just felt I had to point it out. By the way, the book is very good indeed. I have read many PHP manuals and up to now this is the one which explains the language as clearly as possible. I sincerely congratulate you for this exceptional work. Keep it up
So far, I love the 4th edition book. You seem to have an erratum in your list of errata, above, where under the chapter column “9: Creating Web Applications” should be “8: Creating Web Applications”.
Thanks for the nice words. It is appreciated. Thanks, too, for pointing out that mistake. I’ve corrected it.
Still working my way through the book; it is my absolute first intro to PHP and I am enjoying the journey. Note that the tip at the bottom of page 175 refers to the join() function. Since you allude that this function may be arcane, I checked to see if it is listed in the index so that I can find it again should I run across it in real life. A listing for join() is found on page 452. The entry for join() on page 452, however, refers the reader back to page 174, not page 175.
Thanks for catching that and thanks for the nice words on the book!
On page 217, I think there may be an error when you give an example of calling the mail() function regarding commas. Your book appears to read:
mail(‘someone@example.com’, ‘Test Email’, This is a test email’, ‘From: ‘email@example.com’);
is there a comma error in the *From* area? I think you placed an extra comma before *email*.
Not a comma, but an apostrophe. Thanks for pointing that out!
Wow, you are right. I do not know what I was thinking.
On page 307, it reads
“Third, the file tag is used to create the necessary form field…”
Should it read
“Third, the file type is used to create the necessary form field…” instead?
“” follows the line in question.
Either way is fine. I used “file tag”, as in “file element”, because I say “file input type” on the following line.
Hey Larry,
Just finished the book and I liked it a lot as my first PHP book.
Errata: I may be wrong but…
Script 13.11 line 53 ends with: …Favorite<p>’;
Should that be: …Favorite</p>’;
Thanks!
The commentary on Script 9.8, “Deleting a Session”, mentions the session_destroy function at Step 4 (p. 255) but this does not appear in the actual code, either in the book or the download
OTOH, the code example includes unset($_SESSION) which is not mentioned in the commentary.
Sorry about the confusion. I just added this to the list of errata.
In this 4th edition,Chapter 12, the file view_blog.php has been renamed view_entries.php. In numerous places, starting on p.366, the book continues to mistakenly reference the view_entries.php file as view_blog.php.
Thanks, Cindy. I’ll get that added to the list. That’s what I get for making changes at the last minute!
I had a student point out that in Chapter 8, the register.php form tries to place a style tag in the body of the page for the .error class, and this causes validator errors. It would be better placed in the header.html file or the css (as an @media screen style).
And to add a positive note here, your books (php and php/mysql) have been perfect to use as the texts in my class, and I’ve used them since your first editions! Assignments have had to be incorporated, however, so I wanted to mention how happy I was to see the new Review and Pursue sections in this version, and have been incorporating them into the homework assignments. Thanks!
Hello Cindy. As for the CSS, yes, the CSS class definition would be better placed in the header file or in a separate CSS script, but I suspect I was trying to highlight the use of CSS for the formatting of the errors by putting it there.
In any case, thanks for the nice words on the books. It’s very much appreciated. I’m glad that you like them, that you’ve been using them for so long, and that they’ve worked well for you. If there’s anything you’d like to see done differently, added, etc., in future editions, please say the word. I’m also starting to do ancillary materials for instructors, starting with my “Modern JavaScript: Develop and Design” book. They may not help you now, but perhaps in the future. Thanks again!