PHP Ajax Cookbook and over 2 million other books are available for Amazon Kindle . Learn more
FREE Delivery in the UK.
In stock.
Dispatched from and sold by Amazon.
Gift-wrap available.
PHP Ajax Cookbook has been added to your Basket
Trade in your item
Get a £0.08
Gift Card.
Have one to sell?
Flip to back Flip to front
Listen Playing... Paused   You're listening to a sample of the Audible audio edition.
Learn more
See this image

PHP Ajax Cookbook Paperback – 8 Dec 2011

1 customer review

See all 2 formats and editions Hide other formats and editions
Amazon Price New from Used from
Kindle Edition
"Please retry"
"Please retry"
£25.17 £27.06
£27.99 FREE Delivery in the UK. In stock. Dispatched from and sold by Amazon. Gift-wrap available.

Special Offers and Product Promotions

  • Win a £5,000 Gift Card for your child's school by voting for their favourite book. Learn more.
  • Prepare for the summer with our pick of the best selection for children (ages 0 - 12) across

Win a £5,000 Gift Card and 30 Kindle E-readers for your child or pupil's school.
Vote for your child or pupil(s) favourite book(s) here to be in with a chance to win.

Product details

  • Paperback: 340 pages
  • Publisher: Packt Publishing (8 Dec. 2011)
  • Language: English
  • ISBN-10: 1849513082
  • ISBN-13: 978-1849513081
  • Product Dimensions: 19 x 2 x 23.5 cm
  • Average Customer Review: 5.0 out of 5 stars  See all reviews (1 customer review)
  • Amazon Bestsellers Rank: 1,458,591 in Books (See Top 100 in Books)

Product Description

About the Author

Milan Sedliak is a JavaScript specialist, jQuery and Cross-browser compatibility is one of his key strengths. He likes challenging tasks and he does everything he can to be at his best in this area. He has experience with all kinds of websites and a lot of technologies (eight+ years). Portfolios, company presentations, e-commerce, complicated reporting systems for telecommunication devices, PHP websites with MySQL or MS SQL, ASP.NET 3, 5 and 4 (C#) with MS SQL, etc. He has a lot of experience in international environments and is currently employed by Skype as a software engineer specialized in front-end web technologies and cross-browser compatibility. In the past he has worked at Hewlett-Packard, Interoute and Intertec Media Group. R. Rajesh Jeba Anbiah is a very simple guy who first saw computers in 1998. He got addicted to programming and co-authored A to Z of C, a non-profit book on Turbo C/DOS programming, while pursuing Master of Computer Applications in The American College, Madurai. After graduation he joined Agriya, then a startup company, and coded in Perl, Visual Basic, Delphi and heavily on PHP. Currently he heads the projects division in Agriya, where he oversees challenging Web 2.0 sites development, web software products and labs initiatives. His goal at the workplace is to get big branding and coverage for his labs projects. Roshan Bhattarai holds a M. Sc. in IT degree and has previously worked in various IT companies in Nepal and India as a Web developer and Technical Lead. Currently, he co-owns and working as a CTO at Proshore. Roshan owns and authors at one of the popular web development related blog at

What Other Items Do Customers Buy After Viewing This Item?

Customer Reviews

5.0 out of 5 stars
5 star
4 star
3 star
2 star
1 star
See the customer review
Share your thoughts with other customers

Most Helpful Customer Reviews

0 of 1 people found the following review helpful By James Bond on 24 Aug. 2012
Format: Paperback
I have learnt so much from this book about Ajax and it's easy to read and understand - excellent book, thanks!
Comment Was this review helpful to you? Yes No Sending feedback...
Thank you for your feedback. If this review is inappropriate, please let us know.
Sorry, we failed to record your vote. Please try again

Most Helpful Customer Reviews on (beta) 5 reviews
9 of 9 people found the following review helpful
A cookbook is not for learning to cook. 4 April 2012
By Alex F - Published on
Format: Paperback
The sub-title for this book, "Over 60 simple but incredibly effective recipes to Ajaxify PHP websites" is accurate, and if that is what you are looking for, then this book does a good job delivering on it. Many programming training books take you through a single project from start to finish to help the reader gain a deeper understanding of the language or techniques being employed. This is not that style of book. Although the entire volume does flow together for the most part, it seems to work better as a reference to solve a particular problem, or as the title would suggest, a cookbook where you pick the recipe for the task you wish to complete.
I feel it is important to note that a book like this is not for novices. Before reading this book, the reader should already be comfortable with PHP and the server end of their application. The reader would hopefully have a basic understanding of JavaScript structure or at least the jQuery JavaScript library which is used for the vast majority of examples in this book. Without this understanding going in, I fear that the reader will be faced with a great deal of confusion and frustration when trying to understand and learn from the examples given. As some newbies may not be aware, it is necessary to employ JavaScript to use AJAX functionality.

Chapter 1 uses a variety of JavaScript libraries to complete an assortment of AJAX tasks commonly requested in modern web applications. It helps to show some of the strengths and weaknesses of the different libraries. After chapter 1, the jQuery library will be used for all examples.
Chapter 2 shows possible solutions to several common tasks using the jQuery library and AJAX functionality such as form validation, auto-suggest, file uploading, a rating system and pagination. Many of the solutions simply employ the use of a jQuery plug-in to do the heavy lifting. This is fine if your goal is to accomplish the task at hand in an efficient manner. Although each section contains a "How it works..." paragraph, if your goal is to learn and understand WHY it works, this chapter will leave you wanting more.
Chapter 3 continues where chapter 2 ended and addresses tasks such as tool tips, auto-complete, tabbed navigation, an image slider, using a lightbox, drag and drop functionality, a simple shopping cart, and some animation. As in chapter 2, you will not really be doing any programming. You will be using jQuery plugins and the jQuery UI (User Interface) library to accomplish these tasks. Again, there is not anything wrong with this approach if you simply want to add some AJAX functionality to your website.
Chapter 4 covers some more advanced AJAX utilities that will be used on fewer websites such as using a Comet server for live chat, using Google's API to create charts, a very basic OCR (Optical Character Recognition) with very limited practical use, displaying data.
Chapter 5, 6 and 7 seems to take a departure from the previous intended audience. I found these chapters to be filled with useful techniques for debugging and optimizing the JavaScript used for the AJAX functionality. They go over more advanced techniques beyond simply making a plugin work. If the reader does not have an adequate understanding of JavaScript and AJAX by this point, I fear that this chapter would largely be lost on them.
Chapter 8 gives a very brief overview of web services and the most popular formats of them in use at this time. It gives examples of one way to access the API (Application Programming Interface) for Flickr, Twitter, and a few of Google's web services. Some of the examples use PHP on the server side (using CURL), and some use a client side JavaScript interface. I feel that it is important to note that the examples shown are not the only ways to interact with these API's. I do have to point out that there is one rather interesting subject covered in this chapter. The book shows an example of how to locate addresses (retrieved from your database) within certain radius of a certain location using Google's map API.
Chapter 9 covers some basics to keep in mind when beginning to create a version of your web application targeting mobile devices, specifically the iPhone. It briefly covers a couple mobile JavaScript frameworks that assist with this task. This chapter also covers a service called PhoneGap, which allows conversion of HTML, CSS and JavaScript into a native phone application.

In summary, when deciding whether this is a good book for you to purchase, you must really examine what it is that you hope to learn. If you have a solid grasp on the PHP needed for your application, have a basic knowledge of JavaScript and simply want to add some cool effects to your site, then you will probably be very pleased with this book. If you choose to learn more about JavaScript and AJAX from other resources, then the later chapters will also be of use to you. If you are brand new to JavaScript and AJAX, or if you want to build a deep understanding of JavaScript, AJAX or jQuery with the intention of being able to build customized functionality for your website, then this is probably not the best book for you. There are many fine publications that can take you from novice to adept programmer, but that is not the goal of this book. After all, you don't read a cookbook to learn how to cook.

Disclosure: I was provided with a free copy of this book in return for reviewing it.
3 of 3 people found the following review helpful
Veeery useful book - many good code snippets in one place 3 Mar. 2012
By Ivan Ilijasic - Published on
Format: Paperback
I've been in PHP development for more than 10 years and this book is really useful material.

I could recommend it to beginners and experienced developers. From my point of view, there are three types of developer books - complete byte-to-byte fat books, introduction books and cookbooks. I want my cookbook to have useful and simple to use recipes. This book fullfilled my expectations.

Chapter 1 tells about different mainstream JS libraries and framework. You cannot expect from this kind of a book to cover so much information but it's useful to see what is out there. At least you can find useful links or create a list of JS frameworks you should look for.

Almost all the rest this book is all about PHP and jQuery. It has lots of recipes that cover typical developer scenarios. How to create form validation, file upload, dynamic containers such as tab navigators or slideshow, pageless pagination but it goes futher. There are some simple examples how to create drag & drop functionality, sorting, filtering. All common functionalities and I like to see them in one book.

There are some interesting chapters about debugging PHP / JS applications and about best practices how to secure your Ajax applications. Perhaps it would be useful to see addtional pages about PHP security. I know this is a book about PHP and Ajax, not just about PHP but pages about security can be pure gold. Fortunately, this book offers excellent information about online resources.

Mashups chapters talks about usage of common web services. There is one really useful chapter how to create a Google map search in specified radius - how to use PHP, Ajax, Google Map API and MySql. Just like chapter 1 it doesn't go in many details but it gives you enough useful links and library references.

Since I recently started developing HTML mobile apps, I was very pleased to see this topic in this cookbook. That's why it's really nice to see last chapter about PhoneGap.

Recipes in this cookbook are not offering fancy CSS examples with lot of graphics. They are offering pure ideas and solutions.
That's really what every PHP developer should have on his shelf. I would definitely recommend this book. Simple but veeeery useful.
2 of 2 people found the following review helpful
Good book, with lots of ideas for exploration 9 April 2012
By Will 20 - Published on
Format: Paperback
I recently finished reading my first "cookbook" style programming book: PHP Ajax Cookbook: This is my first cookbook review, so I thought I'd start by clarifying what this is and is not. It is not a textbook-style book, similar to "Learn Ajax in 21 days". It is also not a reference book that you can sit on your bookshelf and pull down when you need to look something up. It's a survey of a wide variety of basic techniques that can be implemented with Ajax techniques and how they're done. You should be familiar with both PHP, JavaScript, and CSS before picking this up, or you will get REALLY lost.

With that said, I thoroughly enjoyed this book. I recommend going ahead and downloading the source code files (there's a registration, but it's painless). Some examples are fairly lengthy, and you'll want the source code handy. In fact, this book is between 30% and 50% code!

The layout of the book is chapter around a main concept. Each chapter has several sections, each devoted to a single example. For every example, several things are provided: an overview of what the goal is, the code to implement a simple example (enough for you to build a real-world product), an explanation of how it works, often nearly line-by-line, and a "There's more..." section that gives you additional resources and ideas.

Chapter 1 gives you a quick orientation to JavaScript libraries that will make doing Ajax a lot easier. The practical examples will give you a sense of the style of jQuery, Ext JS, MochiKit, Dojo, YIU, MooTools, and prototype.js. You'll have to learn them on your own, but you will get a sense of how they work, and what they're like. The authors use jQuery for the rest of the book. It's worth using one of these libraries, because raw JavaScript makes doing Ajax calls awkward. The elegance these provide for coding is worth the effort.

Chapter 2 goes over basic Ajaxy things. Form validation (really just jQuery form validation), autosuggest (similar to Google's search), creating a multi-step form wizard, file updload, multi-file upload using Ajax + Flash, implementing a 5-star rating system, etc. The purpose of this chapter is to expose you to how easy Ajax effects are to implement. It's generally a simple combination of CSS and small bits of jQuery that have a powerful effect.

Chapter 3 looks heavily at the extensions that are available for jQuery. Often there are several options (with links provided) of which one is chosen for demonstration purposes. If you're interested in using jQuery, this chapter will provide you with a wealth of resources to give you ideas for cool things you can do. Examples include an image slider, a Lightbox image loader, a shopping cart, and data sorting/filtering.

Chapter 4 pushes this further, showing how to create a chat system and how to decode a simple CAPTCHA using the HTML5 canvas element. These examples are very detailed and will give you a solid idea of the power that is present. One of the key things you will learn is how to do this without using excessive Ajax calls. You can easily kill a server's bandwidth with the "obvious" solution. Thi shows you how to avoid that.

Chapter 5 goes in a completely different direction: debugging. It discusses using Firebug and FirePHP, including the details of how to set both up, in Firefox. It discusses the IE developer toolbar. Memory leaks are dealt with in detail, as are how to deal with various timing issues that can crop up. If you've done PHP/HTML/JavaScript debugging, you already know how annoying this can be. I picked up several tricks, and I thought I was Firebug-savvy!

Chapter 6 discusses optimization issues, including the use of Yslow. It's very easy to make an Ajax site that works poorly, so these tips will help a lot. It discusses where to place sections of code, caching concerns, etc. Most of these are tips you can find in numerous other sites, but they are nicely consolidated, here.

Chapter 7 discusses other best practices, including security concerns and how to address SEO concerns when dealing with dynamic content. Having SEO friendly content means having static content with fixed URL's for each content item. Having Ajaxy content is basically the opposite. This chapter has numerous tips on how to satisfy both requirements, so users can easily find your content.

Chapter 8 discusses ways to use various services that have API's, such as Flickr, Twitter, and Google Maps. These are techniques that can make a website "pop", such as getting a list of nearby restaurants with a map, a customized twitter feed, or image search. As usual, you won't learn the full API, but you will learn the basic techniques for leveraging these APIs on your own site.

Chapter 9 was the most surprising for me. Building iPhone apps using html, Ajax, and PhoneGap. It can also be used for building Android apps, but the authors focused on the iPhone. PhoneGap is a tool that lets you compile an HTML/Ajax page into a native app for the iPhone, Android, etc. It's a tool I'd never heard of, but offers a huge amount of options for the mobile development market.

I enjoyed the book. There's a TON of information here, and the timing was ideal, as I'll be designing a new PHP/Ajax app for my job at work. Topics range from basics of using a framework, to quality layouts, to security concerns. The details will be found elsewhere, but the core ideas are all in here.
1 of 1 people found the following review helpful
Poor Code, Poor Formatting, Poor Everything 23 Nov. 2012
By webdev - Published on
Format: Paperback Verified Purchase
Very disappointed with this book. If you're not already familiar with jQuery, this book will teach you some very poor coding habits, like building placeholder blocks of HTML into your markup rather than generating them dynamically with JS, not to mention the bloated and unnecessary code to do simple things. The PHP in the book is also disappointing, providing almost no server side functionality, and even less in regards to "practical" server side functionality.

None of these recipes provide anything of a dynamic nature, relying mostly on static chunks of HTML in place of server side data.

Formatting is also a mess. Code is scattered and in some cases, missing.

Also, at least 1/3 of the source code is omitted from the publisher's downloadable files. It's sad when books like this pass a publisher's standards.
Great Reference 23 Mar. 2012
By Daedalus - Published on
Format: Paperback
The book focuses primarily on the client-side implementations of Ajax tasks common for almost any web 2.0 application. PHP examples are included where necessary for server interaction.

Most of the examples use jQuery but the book does touch on some other popular JavaScript frameworks including jQuery, Ext JS, MochiKit, Dojo, and YUI library and compares their strengths and weaknesses in different scenarios. There is an entire chapter devoted to the most useful jQuery and jQuery UI plugins including tab navigation, image animation and effects, lightbox, datepicker.

The book begins with fairly trivial examples such as form validation, autosuggest and rating systems but gradually increase in complexity to using canvas for captchas and building two way communication systems using comet. There are also examples of how to implement JavaScript and PHP code to interact with many of the popular webservices online (eg. Google Maps, Facebook, Flickr, IP/Country Lookup, etc.) to create effective mashup sites.

Interestingly, they also cover iPhone webapp development from an HTML5 perspective and also using the PhoneGap framework to access mobile phone hardware features from a web development context. I guess this is a sign of the times and the pervasiveness of the iPhone...

It includes chapters on tools and techniques for debugging JavaScript and techniques for optimizing your code for faster page load times. For someone getting into JavaScript development, this section will be extremely beneficial. Veterans may already be familiar with most of the debugging tools suggested but I learned several cool tricks here.

In most cases, the samples are not watered down with heavy CSS or markup. This allows the code to speak for itself and makes the examples fairly easy to understand if you have a sufficient programming background. This is as a cookbook should be. All in all, it's a great reference of recipes for many of the common features expected in a web 2.0 application. I'm sure I'll be referring back to this for future projects!
Were these reviews helpful? Let us know