Locale Page...  Global  |  Germany  |  UK  |  USA
Your privat CyberGadget - The finest Resources for Web-Designer, Web-Master and Web-Developer!
Quick Search
Advertisement
Partner & Friends
Developersdex
Tutorial Guide
Send News    Add URL / Entry    Tag it:digg it!Stumble It!YahooMyWeb!del.icio.us!Simpify!reddit!Netvouz!Ma.gnolia!FurlIt!Blogmarks!BlinkList!
PHP: Books
PHP Books for Novices and Professionals for Web- and Application Development using PHP und PHP/MySQL
AVG Rating: 9.00
  Added 30 Aug 06   Updated 29 Aug 08
PHP Cookbook (Cookbooks (O’Reilly))  
29.69 $
New from 24.49 $
12 Used from 19.48 $

Author David Sklar
Publisher O'Reilly Media, Inc.
Publication Date 2006-08-25
Paperback - 810 Pages
ISBN 0596101015

Amazon Reviews
amazon.co.uk:
PHP Cookbook is ceartainly the most useful PHP book I own.
amazon.co.uk:
When it comes to creating dynamic web sites, the open source
PHP language is red-hot property: used on more than 20 million web sites
today, PHP is now more popular than Microsoft’s ASP.NET technology. With
our Cookbook’s unique format, you can learn how to build dynamic web
applications that work on any web browser. This revised new edition makes
it easy to find specific solutions for programming challenges.
amazon.co.uk:
Adam Trachtenberg is a technical evangelist for eBay and is the author of two O’Reilly books, "Upgrading to PHP 5" and "PHP Cookbook". He is a frequent speaker at O’Reilly Open Source Conferences and LinuxWorld. Adam has an MBA from Columbia Business School. While there, he focused on general management and operations, with an emphasis on the field of technology. Adam also has a BA from Columbia University. As an undergraduate, he majored in mathematics, and his other studies included computer science and Chinese.

David Sklar is a software developer at Ning, the latest startup founded by Internet hall of famer Marc Andressen. David was a co-founder and the Chief Technology Officer of Student.Com and TVGrid.Com. At both companies, he oversaw the architecture and development of varied systems to deliver personalized dynamic content to users around the world. After discovering PHP as a solution to his web programming needs in 1996, he created the PX (http://px.sklar.com/), which enables PHP users to exchange programs. Since then, he has continued to rely on PHP for personal and professional projects. He is the author of O’Reilly’s "Learning PHP 5", "Essential PHP Tools" (Apress) and the coauthor of "PHP Cookbook" (O’Reilly).
amazon.co.uk:
Chapter 8 - Web Basics

8.0 Introduction
Web programming is probably why you ?re reading this book.It ?s why the first version of PHP was written and what continues to make it so popular today.With PHP, it?s easy to write dynamic web programs that do almost anything. Other chapters cover various PHP capabilities, like graphics, regular expressions, database access, and file I/O.These capabilities are all part of web programming, but this chapter focuses on some web-specific concepts and organizational topics that will make your
web programming stronger.

Recipes 8.1,8.2,and 8.3 show how to set, read,and delete cookies. A cookie is a small text string that the server instructs the browser to send along with requests the browser makes. Normally, HTTP requests aren?t "stateful", each request can?t be connected to a previous one. A cookie, however, can link different requests by the same user. This makes it easier to build features such as shopping carts or to keep track of a user?s search history.

Recipe 8.4 shows how to redirect users to a different web page than the one they requested. Recipe 8.5 explains the session module, which lets you easily associate persistent data with a user as he moves through your site. Recipe 8.6 demonstrates how to store session information in a database, which increases the scalability and flexibility of your web site. Discovering the features of a user?s browser is shown in Recipe 8.7. Recipe 8.8 shows the details of constructing a URL that includes a GET query string, including proper encoding of special characters and handling of HTMLentities.

The next two recipes demonstrate how to use authentication, which lets you protect your web pages with passwords. PHP?s special features for dealing with HTTP Basic authentication are explained in Recipe 8.9. Sometimes it?s a better idea to roll your own authentication method using cookies, as shown in Recipe 8.10.

The three following recipes deal with output control.Recipe 8.11 shows how to force output to be sent to the browser. Recipe 8.12 explains the output buffering functions. Output buffers enable you to capture output that would otherwise be printed or delay output until an entire page is processed. Automatic compression of output is shown in Recipe 8.13.

Recipes 8.14 to 8.19 cover error handling topics, including controlling where errors are printed, writing custom functions to handle error processing, and adding debugging assistance information to your programs. Recipe 8.18 includes strategies for avoiding the common "headers already sent "error message, such as using the output buffering discussed in Recipe 8.12.

The next four recipes show how to interact with external variables:environment variables and PHP configuration settings. Recipes 8.20 and 8.21 discuss environment variables,while Recipes 8.22 and 8.23 discuss reading and changing PHP configuration settings. If Apache is your web server, you can use the techniques in Recipe 8.24 to communicate with other Apache modules from within your PHP programs.

Recipe 8.25 demonstrates a few methods for profiling and benchmarking your code. By finding where your programs spend most of their time,you can focus your development efforts on improving the code that has the most noticeable speed-up effect to your users.

This chapter also includes two programs that assist in web site maintenance. Program 8.26 validates user accounts by sending an email message with a customized link to each new user. If the user doesn?t visit the link within a week of receiving the message, the account is deleted. Program 8.27 monitors requests in real time on a per-user basis and blocks requests from users that flood your site with traffic.

8.1 Setting Cookies

Problem
You want to set a cookie.

Solution
Use setcookie():
setcookie(’flavor’,’chocolate chip’);

Discussion
Cookies are sent with the HTTP headers,so setcookie()must be called before any output is generated.

You can pass additional arguments to setcookie()to control cookie behavior. The third argument to setcookie() is an expiration time, expressed as an epoch time-stamp. For example, this cookie expires at noon GMT on December 3,2004:

setcookie(’flavor’,’chocolate chip’,1102075200);

If the third argument to setcookie()is missing (or empty), the cookie expires when the browser is closed. Also, many systems can?t handle a cookie expiration time greater than 2147483647, because that?s the largest epoch timestamp that fits in a 32-bit integer,as discussed in the introduction to Chapter 3.

The fourth argument to setcookie()is a path. The cookie is sent back to the server only when pages whose path begin with the specified string are requested. For example, the following cookie is sent back only to pages whose path begins with /products/:

setcookie(’flavor’,’chocolate chip’,’’,’/products/’);

The page that?s setting this cookie doesn?t have to have a URL that begins with /products/, but the following cookie is sent back only to pages that do.

amazon.com:
When it comes to creating dynamic web sites, the open source PHP language is red-hot property: used on more than 20 million web sites today, PHP is now more popular than Microsoft’s ASP.NET technology. With our Cookbook’s unique format, you can learn how to build dynamic web applications that work on any web browser. This revised new edition makes it easy to find specific solutions for programming challenges.

"PHP Cookbook" has a wealth of solutions for problems that you’ll face regularly. With topics that range from beginner questions to advanced web programming techniques, this guide contains practical examples -- or "recipes" -- for anyone who uses this scripting language to generate dynamic web content. Updated for PHP 5, this book provides solutions that explain how to use the new language features in detail, including the vastly improved object-oriented capabilities and the new PDO data access extension. New sections on classes and objects are included, along with new material on processing XML, building web services with PHP, and working with SOAP/REST architectures. With each recipe, the authors include a discussion that explains the logic and concepts underlying the solution.

amazon.com:

When it comes to creating dynamic web sites, the open source PHP language is red-hot property: used on more than 20 million web sites today, PHP is now more popular than Microsoft’s ASP.NET technology. With our Cookbook’s unique format, you can learn how to build dynamic web applications that work on any web browser. This revised new edition makes it easy to find specific solutions for programming challenges.

PHP Cookbook has a wealth of solutions for problems that you’ll face regularly. With topics that range from beginner questions to advanced web programming techniques, this guide contains practical examples -- or "recipes" -- for anyone who uses this scripting language to generate dynamic web content. Updated for PHP 5, this book provides solutions that explain how to use the new language features in detail, including the vastly improved object-oriented capabilities and the new PDO data access extension. New sections on classes and objects are included, along with new material on processing XML, building web services with PHP, and working with SOAP/REST architectures. With each recipe, the authors include a discussion that explains the logic and concepts underlying the solution.

Similar Products
Learning PHP 5
New from 12.87 $
Used from 8.98 $
Programming Php
New from 22.77 $
Used from 17.96 $
[ Add a Comment ]Amazon Customer Comments
Great semi-advanced updated book.Rating: 5
17 Jul 2008 @ amazon.com
It is pretty good. Especially for the people who worked a little bit on php but not an expert yet. (That is me.)
Good book for programmersRating: 5
06 May 2008 @ amazon.com
This book is a good reference for people who already have a fair amount of programming knowledge. You don’t need to necessarily know PHP since it’s pretty similar to all the other languages out there. You should however have an idea of how a data driven website works.
There’s a reason its O’RiellyRating: 5
03 May 2008 @ amazon.com
O’Rielly is a name I trust, and often look to for technical manuals. Their cookbooks and pocket guides are particularly sweet.


I am constantly pulling this book for snippets of code. Converting dates all around, array manipulation all the mundane but oh-so-common choirs.

I have already added an extensive collections of methods and classes based on the book’s code. With my newly found admiration of Object-Oriented design and development I am able to reuse the code I create once again and again.

If you are new to Object Oriented coding, check out
Object-Oriented PHP: Concepts, Techniques, and Code

Together you can build powerful classes of date or array methods to handle anything you’ll come across, and anything new only makes them better!
Great way to improve your PHP!Rating: 5
24 Apr 2008 @ amazon.com
Each recipe states a Problem, gives a Solution, adds Discussion to help you understand the "why" behind the "what", and tosses in a "See Also" section if you need more info. There are 26 chapters of problem-solving recipes that will not only get you over the current hurdle but provide for learning in quick bits. Take a couple minutes, try something that interests you, and add it to your toolbox.

Awesome book!
Good for intermediate developerRating: 4
13 Apr 2008 @ amazon.com
This book is not for someone who doesn’t know programming. If you haven’t coded at all in your life and don’t basic PHP syntax you need a different book.

It also isn’t a full solution for your site. You can’t by this book and expect it to provide a complete solution for your programming needs.

What is it. It is a collection of discrete coding examples of how to program. It’s not a book of syntax. It is a book of techniques that you can learn and then use as needed on your own projects.

I haven’t read this book from end to end but when I recently had my first XML project it was useful to learn my different options on how to approach the project. Next I will be working on improving security. Again it has good examples that I can use and MODIFY for my own needs.

Just what I wantedRating: 5
02 Mar 2008 @ amazon.com
I’m coming to PHP with a strong background in Perl and this book is perfect for me. In my mind, I know what I’d do in Perl to handle a given situation. With PHP Cookbook, all I need do is turn to the table of contents, find the section I need, and there’s the solution. The code is well written and the descriptions very useful.
Yes, it’s a GOOD buyRating: 5
12 Dec 2007 @ amazon.com
This review is for the 2nd edition and I got a copy from Amazon for a really good price. The time it already saved me from having to ’think’ was more than worth the price. I did download the source from O’Reilly. It a very good source of usable working code that you can just ’cut and paste’, and you might find yourself learning something here.That is what it was intended to be.
Must have for all PHP developers.Rating: 4
15 May 2007 @ amazon.com
I find most technical books impossible to read from front to back. I typically just use them as reference books. Unfortuanately most techbooks aren’t organized with this in mind. That’s why I love the cookbook series. They tend to contain far more example code then typical programming books and are ideal reference books. The PHP Cookbook is an excellent resouce for PHP novices and experts alike. PHP Cookbook (2nd Edition) is exactly what you would expect from a O’Reilly’s cookbook. Everyone reguardless of skill level will feel they hit the jackpot with this book because it has tons of sample code and examples that explain how to do just about anything imaginable in PHP.

The chapters are organized according to topic and each subsection is basicly a short how-to comprised of a problem, solution and disscussion section that explains the solution in detail. Topics include XML, form handling, database interaction, session management and a lot more. I find all O’Reilly’s cookbooks to be extremely useful and PHP Cookbook is ceartainly the most useful PHP book I own.
A reference every PHP programmer should haveRating: 5
03 Jan 2007 @ amazon.com
This is my first O’Reilly book in the "Cookbook" series. At first I thought this book would probably contain the code and instructions for building a couple of web applications such as a shopping cart or a blog engine. This isn’t that book. Rather it provides the reader with code snippets that can be used as building blocks for all kinds of applications. If I had to describe this book in one sentence I would say it is as if the author took down all the "Hmm..., I wonder how that is done?" questions and created an answer key.

One thing I like about this book is that the authors don’t waste the first few chapters trying to teach or give an overview of the language. Instead they hop right into the usage of the language that relates to real world stuff.

So here is a brief overview. The book covers PHP 5 and goes over many of the new and improved features. The first six chapters provide recipes for more basic subjects (strings, numbers, dates & times, arrays, variables, and functions. Again, this isn’t an intro to PHP, that is another book such as Programming PHP from O’Reilly. This is that book you reach for once you have moved from PHP basics and are ready to build some real world stuff.

By chapter seven the authors are discussing classes and objects. I like using classes when coding in C++, so this is a good chapter for those who like OOP. The next nine chapters go over web stuff starting out with basic things like cookies, forms, and databases. Then the authors go into more advanced areas like session management, XML, automation and web services (REST, SOAP, Mail, FTP, LDAP, and DNS to name a few).

The next chapter [17] is on the topic of graphics. This is a cool chapter if you like to create dynamic images. Things like creating a button image on the fly, or generating charts. Graphics are great to have a knowledge of because everyone likes graphical presentation of data and this chapter can help you get there.

Chapter 18 is on security and encryption which I found rather helpful. No one wants there web application to be the link that allows data to be compromised, and this chapter deals with many of those problem areas. Chapter 19 covers localization, chapter 20 is on debugging and testing. The debugging section does a great job of getting a person setup with the tools they need to properly debug an application including creating your own exception class. This is an outstanding chapter that every programmer can appreciate since every application needs debugging.

The remaining chapters cover performance tuning, regular expressions, files, directories, command line PHP, PERL and PECL. Being a Perl guy I found it interesting to see how the authors utilized regular expressions in PHP. And the chapter on command-line PHP was outstanding; I thought the recipe for creating a PHP command shell was pretty cool.

CONCLUSION
--
This book is like having the answer key to most of the random questions a person comes up with when writing code. I found this book to be very useful, it will be one of those references that I keep close, and gets very little shelf time. It is a solid book. It is hard to say what parts I liked best because this is one of those books that you like and must have, but then as time goes on and you use it more and more its value grows. This is an excellent book and I would strongly recommend it the PHP users that want to move to the next level.
PEAR DBRating: 4
07 Dec 2006 @ amazon.com
This is basically an excellent book. A lot of very useful stuff. Unlike the online PHP manual, it is on this technology called a book. This comes in handy on say a NYC subway train, where you want to brush up on some PHP, or find the solution for something you are working on.

One major warning though: all the database stuff (about 20-30 percent of the book) depends on the PEAR DB class. That is a great thing to use as are many of the PEAR classes. But there is certainly great PHP code that doesn’t rely on PEAR DB.

Besides the db stuff the book has great examples with strings, numbers, I/O (files and directories), dates, etc. And being that I used to be a Reptile Biologist - you got to love that Iguana. If nothing else, just buy it for the cover.
...but if you want PHP 5, this is the book!Rating: 4
18 Nov 2006 @ amazon.com
There is no comparison between Wrox and O’Reilly books! O’Reilly wins hands-down!

This 2nd edition of the PHP Cookbook offers real, useful, insightful information. The content is not "just recipes," but a consise approach to everyday problem solving using PHP. The organization of the book exposes this problem solving as a series of recipes that answer particular problem-domain questions. The diversity of the problem-domains accounted for in this text are amazing! If it is web or Internet related, this book probably has an answer for your most demanding PHP needs.

In the fine tradition of O’Reilly books, this text is very well presented, exceptionally well edited and organized in a manner that makes sense to the reader. It is not filled with fluff or hyperbole designed to add page count the way the thick volumes at Wrox seem to do. If you need every little thought spelled out for you, maybe you should buy a "PHP for Dummies" book. Otherwise, you can’t go wrong with this excellent, well presented book that truly is "Solutions and Examples for PHP Programmers."
...but if you want PHP 5, this is the book!Rating: 4
18 Nov 2006 @ amazon.com
There is no comparison between Wrox and O’Reilly books! O’Reilly wins hands-down!



This 2nd edition of the PHP Cookbook offers real, useful, insightful information. The content is not "just recipes," but a consise approach to everyday problem solving using PHP. The organization of the book exposes this problem solving as a series of recipes that answer particular problem-domain questions. The diversity of the problem-domains accounted for in this text are amazing! If it is web or Internet related, this book probably has an answer for your most demanding PHP needs.



In the fine tradition of O’Reilly books, this text is very well presented, exceptionally well edited and organized in a manner that makes sense to the reader. It is not filled with fluff or hyperbole designed to add page count the way the thick volumes at Wrox seem to do. If you need every little thought spelled out for you, maybe you should buy a "PHP for Dummies" book. Otherwise, you can’t go wrong with this excellent, well presented book that truly is "Solutions and Examples for PHP Programmers."
Any professional PHP user needs this.Rating: 5
07 Nov 2006 @ amazon.com
Web developers might already know PHP, but this updated second edition of a classic still remains an important desk reference to solving common problems and coding obstacles. PHP is used on millions of web sites today, so its depth and applications hold many possibilities for confusion as well as opportunities for optimization choices. PHP COOKBOOK covers all angles, from processing XML and obtaining solutions to common applications problems to working with JavaScript interactions. Any professional PHP user needs this.

Diane C. Donovan
California Bookwatch
Good referenceRating: 4
01 Sep 2006 @ amazon.com
(My review refers to the 2003 edition).

This book has loads of information about stuff you do on a normal basis with PHP, including XML parsing, form processing, string and array manipulation, etc. I think the book is well written and indexed with good examples, but I think you won’t get much more information than the PHP user manual.

In my opinion PHP has better free user documentation than all the other languages I use on a regular basis (Java, Ruby and PERL). You can download their user manual and PEAR manual in a whole bunch of formats, including CHM, which gives you the ability to browse it like any other Windows help file (which gives you the ability to search). Most of the points in this book are covered in the same depth in the PHP user manual and you don’t have to pay for it.
Great Reference Book with excellent examples!Rating: 5
11 Dec 2005 @ amazon.com
You need a solution to a problem? This book will give you the answer. This is a great reference book that helped me a lot and I think that every PHP programmer should own. This book is the next best thing to searching Google for PHP answers where you can find a wealth of information. The examples are very useful and the flow of the book is perfect. When I bought this book it was expensive but it was worth every single penny.

You need to know the basics of PHP coding before this book is useful. But if you know at least the basics you are going to find this book to be your best PHP teacher.
Solid and a good resource for PHP codersRating: 4
06 Dec 2005 @ amazon.com
I read reviews here on Amazon, and I usually see the "perfect for on your desk reference"... well, I have a shelf near my desk and this book doesn’t spend much time collecting dust. There are some really good examples and code, some which may seem overkill (depending on your app and goal).

This is the book I open to see if there’s an example or just to purge ideas/code from.
great book on phpRating: 5
29 Oct 2005 @ amazon.co.uk
This book is definitely not for a beginner wanting to learn php. But as a reference book, it is terrific. There are lots and lots of very useful examples.The material is very well orgainized - you can find what u need very quickly. For each topic, a commonly encountered problem is presented, and then an explanation of how to solve it, along with sample code is given. I used another book to learn php. While that was great for learning, I found it frustrating finding solutions in it to problems i faced when i started work on my php project. This book helped me immensely because it gave me the answers I needed quickly. The numerous examples were a godsend. I highly recommended it as a handy reference.
Good informationRating: 5
21 Sep 2005 @ amazon.com
Well written and easy to understand as is typical of the Sklar books
Great book but desprately needs an update!Rating: 3
23 Aug 2005 @ amazon.com
This is a good book for learning how to use the tools PHP provides. However, in 2005, the tools are out of date... For instance a lot of the XML parsing has been updated so the code in the book is largely deprecated.
Vague, incomplete, and misleadingRating: 2
03 Jul 2005 @ amazon.com
This book contains a huge and misleading inaccuracy about a fundamental aspect of the PHP language, an inaccuracy that could potentially cost an inexperienced programmer many hours of frustration. On p. 155 under "Assigning Object References," Sklar says "use the =& operator to assign one object to another."

In reality, the PHP docs go to great lengths to emphasize that in an analogous example "$a and $b are completely equal here, that’s not $a is pointing to $b or vice versa, that’s $a and $b pointing to the same place." In other words, Sklar is telling readers virtually the OPPOSITE of what’s true.

This is not a trivial semantic point. It’s a fundamental issue, and if it’s misunderstood you can spend many hours hunting down bugs caused by the misunderstanding.

Another major problem is vague language. Here’s an example from page 150:

"Besides using -> to access a method or member variable, you can also use ::. This syntax can access static methods in a class. These methods are identical for every instance of an [sic] class, because they can’t rely on instance-specific data."

OK, so what does this mean? Is Sklar saying that you use "::" when and only when you want to access static methods? Can you also use it to access non-static methods? How do you know when a method is static or non-static? Is the syntax for defining a static method different as in Java, or does it just depend on how you access it?

I suspect that unclear thinking, lack of talent for explaining things, poor editing, and haste all contribute to this lousy quality.

Another problem, also typical of O’Reilly books, is that there is a fair amount of "hand waving" as in, "here’s a light introduction that really gets you nowhere. For further information...uh...see the docs." If I’m paying a lot of money for a tech book, I expect the author to attempt a thorough treatment of the topic, and not just blow it off in the middle.

There are also plenty of typos such as the one in the quoted passage above. Does O’Reilly even bother editing the books they publish?
Cooking with the prosRating: 4
03 Aug 2003 @ amazon.co.uk
This book is excellent, if u often have problems, parse errors, and just dont have a clue why ur db won’t connect (or it has but it wont display ur data) These often problems for php devs can be helped with this book.

DO NOT BUY THIS BOOK IF U HAVE NO OTHER PHP REFERENCE! It is simply somthing u can look in occasionaly and find a cool snipet of code, or if u have a problem troubleshoot through the book... its a good aid but ur not going to learn 2 much new stuff, just how tof ix bugs

Add a Comment!  You must login first, to write an comment/review!
Topic / Title / Summary ...


Comment / Review


 

© 2001 - 2008 CYGAD.NET | All rights reserved. | Terms of Service | About | Time data: GMT +1! | Portal Release X2.6.1 Beta | RunTime: 1.0475
Optimized for Internet Explorer Internet Explorer 6.0+, Firefox Firefox 1.5+!