PHP Hacks: Tips & Tools for Creating Dynamic Web Sites by Jack D. Herrington This errata page lists errors corrected in the most recent printing. If you have technical questions or error reports, you can send them to booktech@oreilly.com. Please specify the printing date of your copy. This page was updated August 6, 2007. Here's a key to the markup: [page-number]: serious technical mistake {page-number}: minor technical mistake : important language/formatting problem (page-number): language change or minor formatting problem ?page-number?: reader question or request for clarification {2} Last paragraph; http.conf should be httpd.conf. (11) Last line; "% mysql --user=root --password=passwordbtest < books.sql" should be: "% mysql --user=root --password=password btest < books.sql" {24-25} Examples 2-5 and 2-6; All the should be --==Multipart_Boundary_ , otherwise MIME structure will be broken. [51] Example 3-4; The order of the and tags should be reversed. Likewise with the order of the and tags. {62} Inside the javascript function drop(), lines 3-4; Lines 3 and 4 in the function drop(): divobj.style.top = aobj.offsetBottom+10; divobj.style.left = aobj.offsetLeft+10; should be: divobj.style.top = (aobj.offsetBottom+10)+"px"; divobj.style.left = (aobj.offsetLeft+10)+"px"; (64) Example 3-8; the table tag has a misspelled attribute: cellspaceing="0" should be: cellspacing="0" (72) First sentence of "Running the Hack"; "...clock.php to your server and navigate to the it..." should be: "...clock.php to your server and navigate to it..." (85) 1st paragraph; flikr should be flickr {88-92} cal.php errors; Page 90: First occurance of cal_days_in_month() should use month with a one base. $dimlm = cal_days_in_month(CAL_GREGORIAN,$lastmonth, $lastyear) $dimlm = cal_days_in_month(CAL_GREGORIAN,$lastmonth + 1, $lastyear) Page 90: Previous month ends a day early. Creating days for previous month needs to subtract 1 from the day value. $days []= new Day(0,$lastmonth+1,$dimlm - ($day -$d), $lastyear); $days []= new Day(0,$lastmonth+1,$dimlm - ($day - $d) - 1, $lastyear); Page 91: Testing if month/year are set in URL should use isset($_GET[..]) instead of if($_GET[...]) otherwise January never shows up in the calendar. (91) Third line of code; $nexmonth should be $nextmonth (154) First and second full paragraphs on the page; "New Name" in the explanatory text should not have the question marks on either side of it (ie. "?New Name?"). [225] Last line of code; 'invoked with with...' should be "invoked with..." {240} 3rd paragraph from the bottom; "with the 3 value set to 1" should be: "with the value for 'bad' set to 1." (251) Last sentence; "...handled by PHP in the MDB() function..." should be "...handled by PHP in the MD5() function..." {261} Last paragraph; "can still link directly to articles by referencing the redirection page and supplying the exact URL..." should be "can still link directly to articles by supplying the exact URL" [272] Example 6-41; the code line $ip = "64.246.30.37" is just for debug and should be removed. [272] Example 6-41; require_once("cache/lite.php"); is unnecessary. $geo->getAddress($ip); is missing after constructor of Net_Geo. {274} Example 6-43; code line beginning "$first= ..." should be: $first= $card['N'][0]['value'][1][0] and the code line beginning "$last= ..." should be: $last= should be $card['N'][0]['value'][0][0] {281} 2nd line from the bottom; Insert into its own line before {312} Example 7-10; StoryURLHandler should be DocumentURLHandler {328} Example 7-18; call_user_func( array( $vis, "visitRecord" ), $r ); should be: $vis->visitRecord( $r ); (353) Second sentence in paragraph following the push-pin note; "docs/index.html" should be "doc/index.html" (370) In Handler_message_normal(), "if" clause is unnecessary. (372) In NOAA(), $PERSONAL and $NOAA must be specified as "global". The $PERSONAL and $NOAA variables should be added to the global line at the top of the function. (387) 2nd paragraph; "...index.phpfile..." should be "...index.php file"