PROGRAMMER TUTORIALS
solutions to programmer problems

ASP
C#
C++
COBOL
Delphi
HTML
Java
J2EE
JavaScript
JSP
.NET
Perl
PHP
SQL
Visual Basic
XML
View Shopping Cart


Get a FREE Apple iPod Photo

  Books AJAX and PHP: Building Responsive Web Applications

Rating: 5 out of 5 stars - It's Much More than AJAX and PHP
I admit, when I first opened this book, I thought it would contain a dry discussion of how to use AJAX methods with PHP. But the book turned out to be so much more than advertised, I think its title must be wrong. It should have been called, "How to Use AJAX Methods with PHP, MySQL, DOM, CSS, SVG, XSL, XML, RSS, and JavaScript Frameworks." I certainly never expected to read it cover to cover, but that's what I did.

In addition to integrating a wide range of modern web technologies, the book contains great examples of how to write building blocks for powerful web applications. These include form validation, chat, suggest, auto-complete, charting, grid, RSS, and drag-and-drop. Somewhere in the code for these functions are techniques for almost everything you might want to program into an application. What I really like about the book, however, is the ongoing explanation of how to write the code so it will be secure, and will perform correctly in every browser. Most books I have read don't bother with such details, but this one even lays out a method to create user-friendly error reporting in production mode. It has a strong focus on writing code that might actually be used in a production environment.

My only quibble with the authors is that they seemed to be avoiding OOP in their JavaScript, though they used it with their PHP code throughout the book. They said OOP emulation techniques required a longer learning curve. However, the result of their decision is JavaScript files that run for seven or eight pages. I really think that OOP would have been less intimidating to a new programmer than page after page of unbroken code. I would recommend that the authors at least use eye-catching headers for the major functions in these files to help the reader understand the structure of the code. (Readers of the book as published might want to take a highlight pen to the function headings.)

As someone who is attempting to write my first significant web application, I think this book is wonderful. I expect to wear it out before I'm through looking up techniques. I already know that my application will need chat, validation, suggest, and data grid. This book practically hands me the code for these. But more than that, it provides me with a view of the basic methods to do many other things.

Much of the major content of this book is code. While the authors explain how the code works, the reader will still need to know the basics of HTML, CSS, SQL, and scripting languages, such as PHP and JavaScript. Another major advantage of this book, however, is that the authors give web links to many of the best tutorials on these topics. In fact, it would be possible to start with this book, and use the authors' suggested links to look up almost every major web technology in order to learn it in the context of AJAX and PHP. All in all, that's a lot of value for a book that has less than 300 pages!



Rating: 5 out of 5 stars - AJAX and PHP by Example
This book teaches by example. The first few chapters introduce AJAX and what part PHP, Javascript and XML all play. Then the remainder of the book takes you through several example applications. The example apps are simple enough that you can easily follow. These applications include Form Validation, Chat, Suggest and Autocomplete, Charting with SVG (Scalable Vector Graphics), using grids, and Drag and Drop.

Each example begins by showing you the source code and how to actually implemented/deploy that application. There is also a supporting appendix for additional information about deploying the examples on a web server. Then each chapter follows by by explaining how the example worked.

If you would like to quickly begin using AJAX from PHP this book is a great start.



Rating: 4 out of 5 stars - Very concise and non-labored reading
This book tends to jump right in and show you the important parts of the code you will need for your applications. It walks you through creating some of the more requested scripts and explains each step in just enough detail to give you a good grasp. That said, the book isn't a major read at under 300 pages, which makes it light enough to get through in a weekend if needed. I highly recommend this book for those wanting to combine the power of AJAX with the speed and ease of PHP.



Rating: 5 out of 5 stars - Just what I needed
Ajax and PHP came at exactly the right time in my self-inflicted education as I am just now gaining functional literacy in OOP, Client/Server. PHP, CSS et. al..

There are a lot of things to like about this book, starting with its organization. It starts off by documenting what you need to know to best use of this book. And supplies the URL/Hyperlinks to get those literacies if you don't have them. (Thank you!)

It achieves a nice balance of choosing what needs to go into an appendix.

It dispenses with the common irritating practice of showing code "excerpts" in favor of showing the entire script and follows each script example with a "What just happened" section that is as clear and concise as you will find anywhere.

If you only buy one AJAX book, make it this one.




Rating: 4 out of 5 stars - Building AJAX and PHP skills with Packt: Recommended
The book is good, the topic is right, and pretty much everyone is thrilling to learn how to benefit from AJAX -- even if this means you're going to use a lot of JavaScript, which you thought it was not necessary, since you know PHP, a powerful language, right?

To be frank, I was contemplating this book quite a lot before daring to open it for real. I can't really explain why, but I was intimidated by the idea: not by its size (274 pages is a common size), not by the technology itself (I'm coding PHP pretty often, and JS is no more than... JS), so maybe it was just because I'm too conservative. I'm prone to use PHP pages the "go-to-the-server-and-come-back-with-another-one-please" way.

And this book really tries to learn you the basics of AJAX, through practical examples, that is. Quite impressive, given that most of us are usually grabbing new ideas & technologies from on-line articles, not from books entirely dedicated to a subject.

Packt (pronounced "packed") has made every effort to support this book, even up to a point where you're overwhelmed by their will to make it easier for you.

Here's what the web offer is:
* A book's "classical" page with the publisher
* A book's mini-site with the publisher, featuring demos of the case studies developed in the book
* A book's mini-site with one of the authors, hosting an Errata and Notes

Downloadables:
* Chapter 1: AJAX and the Future of Web Applications
* AJAX Chat Revised - Chapter 5: Ajax_Chat_and JSON, a revised version of Chapter 5, now using and presenting JSON instead of XML. The first printed edition is only featuring the original XML-based chapter.
* AJAX Whiteboard mini-book - a case study on how to implement efficient client-server communications when heavy realtime communication is needed.
* Appendix A - installing and configuring Apache, PHP, MySQL, and prepare the database used in the demos.
* Appendix B: tools that can make your AJAX and PHP programming/debugging life easier.
* Appendix C: - Advanced XML: XPath and XSLT.
* Code download: the code for the samples described in the book.

Let's get to the point.

The first contact with AJAX was, for most people, the suggest & autocomplete feature of Google Suggest, somewhere at the end of 2004 or beginning of 2005. If you want to implement such a feature for yourself, the whole Chapter 6 is dedicated to this subject: you will be implementing suggestions from PHP functions, with direct redirection to the corresponding manual page.

Unless you don't actually need any book on the matter, you should start with the beginning, to get a clear idea of what "Asynchronous JavaScript with XML" really is, and why is it needed to improve usability and to make a site more responsive, or to find out some drawbacks of using AJAX (bookmarking may become pointless).

The basic principles of AJAX are very much disclosed from the first chapter, where you're presented with a simple (and useless) simple PHP AJAX application, described in detail.

There is to note that the book features the full sources of all the applications used in the instructional process. If you download the source code, the use of the printed one is somehow limited, unless you want to make notes on the book, for analysing how things are done.

To ease the understanding, the book holds a few flowcharts, in key places. Otherwise, a rather important number of screenshots are presented to help you follow the topic even if you're not in the front of your computer.

OK, you're an intermediate PHP developer, but you know very few of JavaScript. Client-side scripting was not one of your major interests. How are you going to swallow the book?

Chapter 2 is set to make you feel more relaxed and comfortable. Not only it describes JavaScript and the Document Access Model (DOM) in a nutshell, but it also provides you with useful reference links (page 30).

As a general rule, you will find useful URLs in several places throughout the book, so be prepared to improve your skills even after having finished with it.

The next "hard nut" is the very heart of AJAX: the XMLHttpRequest object. You will learn of it in the same Chapter 2, and the table at page 47 lists its methods and properties.

But it wasn't tough, so far. Most people already knew about DOM (at least if they have used CSS), and a bit of JS too. Some people never needed to use XML though, but, you know, the "X" in AJAX is from XML, even if there is no XML involved in the functioning of XMLHttpRequest, and you're not bound to use XML if you don't want to!

XML is a vast subject, and so are DTSs, schemas and namespaces, XSLT and Xpath, etc. Page 55 lists some starting points, and recommends Appendix C (not present in the first printed edition) for an introduction to XSLT and Xpath.

Fininshing the Chapter 2, which is very dense in information, will get you introduced to some basic handling of XML, but more important, to handling errors and throwing exceptions.

In the real world, you will need to do some serious data processing at the server level. This is what Chapter 3 is meant for, with some more examples too.

This time, you will also need to work with a database, MySQL in our case. Make sure you'll properly setup the database, because you will need to create some tables in some future sample project too -- fortunately, the book is supportive, especially if you're using phpMyAdmin.

As a general rule, once the access to the database is solved, everything should "just work". Each sample needing MySQL access has the credentials in a config.php file, so it's better you just create the user "ajaxuser" with the password "practical", to avoid editing several files.

The only problem I encountered was an error message:
"Class 'mysqli' not found"
which should be solved by adding
extension=mysqli.so
or
extension=php_mysqli.dll
to php.ini (and don't forget to restart Apache).

One of the first usability gain of using AJAX is form validation within the same page, without pushing back and forth error pages and the like. This is the first thing I'll implement in a web site in the process of "ajaxing" it -- and you will read Chapter 4 to get a good grip of one of the most useful usages of AJAX.

The rest of the book is very much a sequence of labs where you will learn more and more through practical exercises, with full code and explanations provided. You will do with AJAX:
* a web chat (Chapter 5).
* real-time charts with SVG (Chapter 7).
* grids with client-side XSLT (Chapter 8).
* a RSS reader (Chapter 9).
* drag and drop (Chapter 10).

What are my impressions with this book?

Once I went beyond the initial reluctance, I could see the book is actually not a bad one. The four Romanian authors did a good job, although some would have appreciated if a more playful style was used, instead of the rather academic one. For instance, PHP books by Julie C. Meloni can be swallowed easier due to the lighter style, more appropriated for people not willing to feel like in the front of a teacher.

Also, fragmenting the code with more comments shouldn't hurt -- no, actually not "code comments", but textual descriptions of what is actually happening in there.

For a practical introduction into AJAX with PHP, I would rate the book with 4 stars out of 5, but not more, for style reasons mainly.


page 4 of  6
 1  2  3  4  5  6 


2000-2006 ProgrammerTutorials.com


Top100WebShops.com