Chapter 2. Some small errors in add_post.php and view.php
PROBLEM #1
Ending anchor tag </a> is missing in the following places.
1. view.php page 49, first gray box, 9th line from the bottom
Code:
echo htmlspecialchars($row['SUBJECT']) . '</li>';
should be
Code:
echo htmlspecialchars($row['SUBJECT']) . '</a></li>';
2. view.php page 53, about 19th line from the top.
(This is just a repeat of the above as the book shows us parts of the
file, then the complete file.)
3. view.php page 53, about 9th line from the bottom
Code:
echo htmlspecialchars($row['DESCRIPTION']) . '</li>';
should be
Code:
echo htmlspecialchars($row['DESCRIPTION']) . '</a></li>'
I notice the download code has this problem as well.
If you don't change these, everything after the anchor tag will
be highlighted, until it hits the next anchor tag. I
noticed this because I had debugging statements in between the posts
and they were getting highlighted too.
PROBLEM #2
It looks like they mistakenly copied the message "Invalid forum id"
to places where it should say "Invalid message Id".
Code:
die(<p>Invalid forum id.</p>);
Should be
Code:
die(<p>Invalid message id.</p>);
Here are the 4 places I see it.
file add_post.php page 44 The first gray box, 3rd line from the bottom.
file add_post.php page 45 10 lines from the bottom.
view.php page 47, 7 lines from the bottom
view.php page 51, 17 lines from the top.
In the download code they have taken this message out.