Most Helpful Customer Reviews
|
|
10 of 11 people found the following review helpful:
1.0 out of 5 stars
533 pages of horrible PHP and 31 pages of index, September 27, 2008
I picked this book up at my local library since it was the first PHP 6 book they carried. I have to say, I completely agree with Michael Diamond's review. This book is why PHP code and PHP coders have a bad name. I would absolutely not hire someone who wrote any code like the examples in the book. The book is full of examples of how to make completely broken, utterly insecure and just downright awful PHP scripts. Throughout the book, examples take user input directly from $_POST or other user provided variables and either call functions provided in the variable, use the variable directly in SQL.
If the code could throw a warning, it is often preceded with an @ sign, which in PHP just suppresses the warning. Rather than show or explain to the reader how to either prevent the warnings from appearing, checking code to make sure the values passed to the function won't cause a warning or any of the other correct, standard, and not dangerous ways of preventing warnings from showing to the user, it just includes the @ sign with no explanation.
Throughout the book I don't recall seeing a single place where array variables are accessed correctly. For example,
if ($_SESSION[valid] != 'Yes') ....
Unless the word valid is a defined constant, PHP will try to find a constant with that name, not find any, issue a notice, and then try to use valid as a string. The correct way to do this check would be
if ($_SESSION['valid'] != 'Yes')...
Additionally, for a book that is supposed to be about PHP 6, very little PHP 6 is actually discussed anywhere. Unicode will be one of the biggest additions to the PHP 6 code, yet the only place that even mentions unicode is page 68 which has a little 3 line text box. The text in the box mentions that with PHP 6, unicode will be on by default, and then tells you how to disable it by changing an ini setting!
The code examples in this book are aimed at a beginner PHP programmer. However, a beginner PHP programmer may not know how wrongly they are being presented. I urge you, if you are a beginning PHP programmer to avoid this book. If you are a beginning programmer, avoid this book. If you are an intermediate to expert PHP programmer, avoid this book, or borrow it and laugh at the horrible examples of how to not code PHP.
I read a lot of PHP books. Since I've been coding PHP since 1997, there's usually not a lot that I learn from the PHP books. However, I usually also don't have such a strong reaction against a book that I have to immediately write an Amazon review urging others to avoid a book. In fact most of the other PHP books I've read or own do have a lot of good.
Please, stay away from this book. If you don't know PHP already, it will ruin you as a PHP programmer.
|
|
|
5 of 5 people found the following review helpful:
1.0 out of 5 stars
This Book Is The Reason PHP Programmers Have A Bad Name, May 20, 2008
This book tries to teach PHP with an illogical ordering, piss poor documentation, no regard to security or standards (it's being published as a book for PHP 6, but still uses HTML from the 1990's).
Most notable to me, however, was the god aweful piece of code found in one of the introductory chapters which, if ever put on a live server, would open up the server to any number of exploits, including access to the system() function. Here is an excerpt:
echo $result = $_POST['func']($_POST['text1']);
Yes, that's right, output the result of a function call the client provides, applied to a parameter the client provides. Absolutely ridiculous.
Now, I haven't read much further than this example (p 110), but even if somewhere later on the authors take the time to discuss security, the fact that they separate the two all but guarentees that the message is not getting across. Please, please please do not purchase this book. I am returning it today, and I encourage those of you who made the same mistake I did to return it as well.
A far, far better book which covers PHP and MySQL in a professional, secure, and yet introductory fasion is PHP and MySQL Web Development (4th Edition) (Developer's Library). This is far and away my favorite programming book, and I promise anyone who is interested in learning PHP or MySQL will benefit from this book.
|
|
|
2 of 2 people found the following review helpful:
2.0 out of 5 stars
Inconsistent and flawed, March 25, 2008
Pro: The text is written in a simple, straightforward style, and contains some good information
Con: Ridiculously small graphics depicting code (hint: just use listings); sample code from publisher's site is broken (perhaps I missed the part about having to debug the authors' examples); broken examples in the text; PHP6 is not stable as of publication of the book but we're set to a hack install thereof, and it appears the instructions on that little endeavor are broken too ("put that .dll in one of those folders you Windows people use").
Suggestion: Try the w3schools site. It's simple yet comprehensive, it's free, and they test their code. Or if you must have a dead tree, try Gosselin's PHP Programming with MySQL -- from what I have seen, it's a much better book.
|
|
|
Most Recent Customer Reviews
|