PHP Errata Sheet
When you find errors in the textbook, let me know so that I can post an errata sheet.
Email jscholl@austincc.edu, to add errata to the sheet.

Big thank you to Sharon Joiner for beginning our errata sheet!
Error Handling
Check out your php.ini file and look for the error handling. It is probably turned off for display in the page ... with the comment that they strongly recommended that it be turned off, but that errors be logged in a log file.
Look for the log file and see if you find your errors listed.

Page 93
The example at the top of the page talking about using parens with echo statements:
The example in the book appears as follows:
        <?php echo ("Explore Africa, ", "South America, ", " and Australia";); ?>
The semicolon before the closing paren is a mistake. Actually, the space in front of the "and" in the third string doesn't belong there, but it doesn't cause the echo statement to fail, and the extra semicolon does.

Page 125
"Next, you modify the second and third elements ... ", should read "... third and fourth elements ...".
The indices of the array are correctly written as 2 and 3.

Page 130
Next to the last paragraph.
"One way of creating a new student ID number is to store the last assigned student ID in the $StudentID variable. When it's time to assign a new student ID, the script could retrieve the last value stored in the $StudentID variable and then increment its value by 1."

The next sentence goes on to say, "In other words, the last value stored in the $StudentID variable will be the next number used for a student ID number."

Whereas, the way I read the two sentences immediately preceding it, it should have been,
"In other words, the last value stored in the $StudentID variable was the last student ID number assigned, and it needs to be incremented before assigning a new one."

Page 138
Paragraph immediately following the caution and tip at the top of the page, end of the paragraph.
"For example, the statement $ReturnValue = 10 == "ten"; returns a value of false because the PHP Scripting engine cannot convert the string "ten" to a number. However, the statement $ReturnValue = 10 == "10"; returns a value of false because the PHP Scripting engine cannot convert the string "10" to a number."

In point of fact, '$ReturnValue = 10 == "10";' assigns a value of "true" to $ReturnValue, because the scripting engine is able to convert "10" to 10.

Page 163
In the code just above the "The global Keyword" heading, $LocalVariable is declared nested in a paragraph tag pair.
That's not wrong, but it's, at the very least, unnecessary duplication, and useless.

However, the thing that should be noted is that if you try to print, outside a function, a local variable declared inside the function (as this is trying to demonstrate), you do not necessarily get an error message. It may be that some servers *do* provide error messages for that, but it should be noted that you won't necessarily get an error message.

Page 165
Bottom of the page, talking about invoking global variables inside a function without first declaring them with the "global" keyword.
What it *does* say is that you use the global variable's name as an index into the autoglobal array, $GLOBALS. What it doesn't say there (it may later in the text), and should, is that when you use the global variable's name as an index, you remove the "$" from in front of it.

Page 169
"Next, you create a PHP script that displays form values submitted with the Great Explorers quiz."
/* comment: so far, so good, but then ... */

"To create the Great Explorers quiz and its form section:"
/* comment: umm ... wasn't that what we just finished doing? */

Page 259
The syntax for the fopen() function is:
open_file = fopen("text file", "mode");
Although correct, it appears that open_file is a variable name or a reserved word. It is neither. Your handle name must start with a $. It would make more sense if the text said
$open_file = fopen("text file", "mode");