Corrections and Updates for:
PHP Advanced for the World Wide Web: Visual QuickPro Guide
The following places are missing parentheses for the require_once()
function. In every case, require_once "/code/filename.php";
should be changed to: require_once ("/code/filename.php");
-Page 184, step 15
-Page 205, lines 99 & 100
-Page 207, step 23
-Page 222, line 6
-Page 225, lines 99 & 100
1: Advanced PHP Programming On page 20, in Script 1.6 the comment on
line 21 ("Read the file into an array") is a misprint. That line is
actually opening a file for writing. The same applies to page 27, Script
1.9, line 31.
1: Advanced PHP Programming On page 10, at bottom of first column the
function
function print_albums ($value, $key) {
echo $value. "
\n
}
is missing the closing ";.
4: Security On page 160, Script 4.8, line 11 reads
(strstr($PHP_SELF, "login.php"))
but should have an "if " before it, as written in step 6 on page 162.
if (strstr($PHP_SELF, "login.php"))
5: On page 175, in the second Tip, there should be no comma after INDEX
(group_name).
On page 199, in step 4 and in the corresponding Script 5.7, the closing
tag is missing.
5: On pages 201-202, in Script 5.9, lines 19, 22, 25, 27, and 29
(written in Step 12) mistakingly use "$this->$error_message" instead of
the proper "$this->error_message".
5: On page 213, in Script 5.12, line 6 is missing the required
parentheses for the require_once(); line.
5: Dynamic Web Applications In Script 5.17 on page 226, SID on line 27
will not have a value because session_start() is only called if the user
is sucessfully logged in. (To be frank, I cannot recall right now
exactly why I set it up this way.) As it stands you should either remove
the $sid_value from lines 27-28 or move the session_start() line to the
very beginning of the page.
On page 230, in the right hand column, there are an uneven number of curly
braces. There should be another end brace before set_error_handler().
8: PHP and the Server On page 309, in Script 8.6, line 18 should read:
$fp = fopen ($filename, 'w');
10: Image Generation On page 346, in the last paragraph, the line
"coordinates of 10,50 means that the upper-right portion of the first
character in the string will begin" should say that "the upper-left
portion of the first character in the string will begin...".
Appendix A: Installation On page 465, under step 2, the line should read
curl -O http://www2.entropy.ch/download/libphp4.so.gz
The zero as it is printed in the text ought to be a capital letter O.
Appendix B: Databases Page 475, Table B.4, the row for ENUM is out of
alignment. The "1 or 2 bytes" line should be under Length column and
"left" should be under Example.
Appendix B, Databases Page 476, the sidebar should be titled "Common
Database Mistakes", not "Command Database Mistakes".
3: On page 63, the third tip should statate that PHP does not support
mutliple inheritances--building a class based upon more than one other
classes. PHP does support multiple levels of inheritance.