Wiley.com
Print this page Share

PHP and MySQL: Create - Modify - Reuse

ISBN: 978-0-470-19242-9
Paperback
341 pages
May 2008
PHP and MySQL: Create - Modify - Reuse (0470192429) cover image
This title is out-of-print and not currently available for purchase from this site.

Do you think you've discovered an error in this book? Please check the list of errata below to see if we've already addressed the error. If not, please submit the error via our Errata Form. We will attempt to verify your error; if you're right, we will post a correction below.

ChapterPageDetailsDatePrint Run
Error in Code
login.php Line 21:

if ($user->userId && $user->password == sha1($_POST['password']))

Should be

if ($user->userId && $user->isActive && $user->password == sha1($_POST['password']))
10/14/09
Error in Code
Chapter 1, User Registration, the forgotpass.php file:

// store new password
$user->password = $password;
$user->save();

Should be:

// store new password
$user->password = sha1($password);
$user->save();
10/14/09
48 Error in Text
echo htmlspecialchars($row['DESCRIPTION']) . '</li>';

Should be:

echo htmlspecialchars($row['DESCRIPTION']) . '</a></li>';

This appears again on page 53 as view.php and should be corrected there as well.
11/23/09
49 Error in Text
echo htmlspecialchars($row['SUBJECT']) . '</li>';

Should be:

echo htmlspecialchars($row['SUBJECT']) . '</a></li>';

This appears again on page 53 as view.php and should be corrected there as well.
11/23/09
69 Error in Text
Lower gray box on page:

$p->connection

should be

$p->connect
11/23/09
77 Error in Text
manage.php code line 11 left off semicolon at the end of the line

The line should be:

$pop->user(MANAGE_USER);
11/23/09
79 Error in Text
The case 'HELP' block needs to have a break statement

The code should read:

case 'HELP':
$response_file = 'help.txt';
break;
11/23/09
129 Error in Text
The section "Sending Reminders"
The notify.php code in the gray box

The 7th line down is missing ending single quote on the actual email address.
This is wrong in the book and in the download code.
(note the download code has different email address,
but they still forgot the single quote at the end).

in the book
Code:
define('EMAIL_ADDR', '[email protected]);
and in the download code
Code:
define('EMAIL_ADDR', '[email protected]);
It should be like
Code:
define('EMAIL_ADDR', '[email protected]');

1/14/10
130 Error in Text
notify.php, in the first gray box where it says mail,

mgs should be msg. This is wrong in both the book and download code

The book has it like this.
Code:
mail(EMAIL_ADDR, "Reminders for $month/$day/$year $hour:$minute $am", $mgs);
It should be like this, (msg instead of mgs)
Code:
mail(EMAIL_ADDR, "Reminders for $month/$day/$year $hour:$minute $am", $msg);
1/14/10
222 Error in Text
The last word in paragraph 1 on p.222 is SystemOverflowException.
This should read System.StackOverflowException, as this is the error thrown at runtime when compiled code contains an infinite loop between two class constructors.
2-16-11
11 309 Error in Code
Reads: STEDRR.

Should be: STDERR
11/09/2010
320 Code Error
On page 320, at the top of the page there is a gray box section containing code,
The variable $target is not defined (line 10); This will give you an error.
The code should contain $template, not $target, on page 320. The correct code excerpt should be:
<?php define(TEMPLATE_DIR, '/srv/apache/example/templates/');
if (isset($_GET['t']))
{
$template = realpath(TEMPLATE_DIR . $_GET['t']);
}
if (isset($template) && strpos($template, TEMPLATE_DIR) !== 0 && file_exists($template)),
{
include $template;
}
else
{
include TEMPLATE_DIR . 'default.php';
}
?>
2-16-11
323 Error in Code
On page 323, about 12 lines down, there is a gray box illustrating a line of code. The sample should read:
$query = sprintf('SELECT USERNAME, EMAIL_ADDR FROM WROX_USER WHERE ' .
'USER_ID = %d', $_POST['userid']);
2-16-11
Back to Top