AJAX and PHP: Building Responsive Web Applications


AJAX and PHP: Building Responsive Web Applications
eBook: $20.99
Formats: PDF, PacktLib, ePub and Mobi formats
$10.50
save 50%!
Print + free eBook + free PacktLib access to the book: $55.98    Print cover: $34.99
$17.50
save 69%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Overview
Table of Contents
Author
Reviews
Support
Sample Chapters
  • Build a solid foundation for your next generation of web applications
  • Use better JavaScript code to enable powerful web features
  • Leverage the power of PHP and MySQL to create powerful back-end functionality and make it work in harmony with the smart AJAX client
  • Go through numerous case studies that demonstrate how to implement AJAX-enabled features in your site such as: real-time form validation, online chat, suggest & autocomplete, whiteboard, SVG realtime charting, whiteboard, web data grid, RSS reader, drag & drop

Book Details

Language : English
Paperback : 284 pages [ 235mm x 191mm ]
Release Date : March 2006
ISBN : 1904811825
ISBN 13 : 9781904811824
Author(s) : Bogdan Brinzarea, Cristian Darie, Filip Cherecheş-Toşa, Mihai Bucica
Topics and Technologies : All Books, Web Development, AJAX, Open Source, PHP, Web Development



Table of Contents

Preface
Chapter 1: AJAX and the Future of Web Applications
Chapter 2: Client-Side Techniques with Smarter JavaScript
Chapter 3: Server-Side Techniques with PHP and MySQL
Chapter 4: AJAX Form Validation
Chapter 5: AJAX Chat
Chapter 6: AJAX Suggest and Autocomplete
Chapter 7: AJAX Real-Time Charting with SVG
Chapter 8: AJAX Grid
Chapter 9: AJAX RSS Reader
Chapter 10: AJAX Drag and Drop
Appendix A: Preparing Your Working Environment
Index
  • Chapter 1: AJAX and the Future of Web Applications
    • Delivering Functionality via the Web
      • Advantages of Web Applications
    • Building Websites Since 1990
      • HTTP and HTML
      • PHP and Other Server-Side Technologies
      • JavaScript and Other Client-Side Technologies
      • What's Been Missing?
    • Understanding AJAX
    • Building a Simple Application with AJAX and PHP
      • Time for Action—Quickstart AJAX
  • Summary
  • JavaScript Events and the DOM
    • Time for Action—Using JavaScript Events and the DOM
  • Even More DOM
    • Time for Action—Even More DOM
  • JavaScript, DOM, and CSS
    • Time for Action—Working with CSS and JavaScript
  • Using the XMLHttpRequest Object
    • Creating the XMLHttpRequest Object
      • Creating Better Objects for Internet Explorer
    • Initiating Server Requests Using XMLHttpRequest
    • Handling Server Response
      • Time for Action—Making Asynchronous Calls with XMLHttpRequest
  • Working with XML Structures
    • Time for Action—Making Asynchronous Calls with XMLHttpRequest and XML
  • Handling More Errors and Throwing Exceptions
  • Creating XML Structures
  • Summary
  • Passing Parameters and Handling PHP Errors
    • Time for Action—Passing PHP Parameters and Error Handling
  • Connecting to Remote Servers and JavaScript Security
    • Time for Action—Connecting to Remote Servers
  • Using a Proxy Server Script
    • Time for Action—Using a Proxy Server Script to Access Remote Servers
  • A Framework for Making Repetitive Asynchronous Requests
    • Time for Action—Implementing Repetitive Tasks
  • Working with MySQL
    • Creating Database Tables
    • Manipulating Data
    • Connecting to Your Database and Executing Queries
      • Time for Action—Working with PHP and MySQL
  • Wrapping Things Up and Laying Out the Structure
    • Time for Action—Building the Friendly Application
  • Summary
  • Summary
  • Summary
  • Summary
  • Summary
  • Chapter 8: AJAX Grid
    • Implementing the AJAX Grid Using Client-Side XSLT
      • Time for Action—AJAX Grid
  • Summary
  • Chapter 9: AJAX RSS Reader
    • Working with RSS
      • The RSS Document Structure
      • Google Reader
    • Implementing the AJAX RSS Reader
      • Time for Action—Building the RSS Reader Application
  • Summary
  • Chapter 10: AJAX Drag and Drop
    • Using Drag and Drop on the Web
      • Shopping Carts
      • Sortable Lists
    • Building the AJAX Drag-and-Drop Sortable List Application
      • Time for Action—Task Management Application with AJAX
  • Summary
  • Appendix A: Preparing Your Working Environment
    • Preparing Your Windows Playground
      • Installing Apache
      • Installing MySQL
      • Installing PHP
    • Preparing Your *nix Playground
      • Installing Apache
      • Installing MySQL
      • Installing PHP
    • Installing phpMyAdmin
    • Preparing the AJAX Database

Bogdan Brinzarea

Bogdan has a strong background in Computer Science holding a Master and Bachelor Degree at the Automatic Control and Computers Faculty of the Politehnica University of Bucharest, Romania and also an Auditor diploma at the Computer Science department at Ecole Polytechnique, Paris, France.

His main interests cover a wide area from embedded programming, distributed and mobile computing and new web technologies. Currently, he is employed as an Alternative Channels Specialist at Banca Romaneasca, Member of National Bank of Greece where he is responsible for the Internet Banking project and coordinates other projects related to security applications and new technologies to be implemented in the banking area.


Cristian Darie

Cristian Darie is a software engineer with experience in a wide range of modern technologies, and the author of numerous books, including his popular AJAX and PHP tutorial by Packt, his ASP.NET E-Commerce tutorial, by APress and his forthcoming SEO tutorial for PHP developers by Wrox Press. Cristian is studying distributed application architectures for his PhD, and is getting involved with various commercial and research projects. When not planning to buy Google, he enjoys his bit of social life. If you want to say "hi", you can reach Cristian through his personal website at http://www.cristiandarie.ro.


Filip Cherecheş-Toşa

Filip Chereches-Tosa is a web developer and entrepreneur, with a strong belief in the future of web-based software and open source. He started his career at the age of 9, programming BASIC on a Commodore 64.

Filip blogs in Romanian on www.filipcte.ro and is an active member of the largest IT communities in Romania. He's always involved in side-projects, one of the latest being jobberBase (www.jobberbase.com), open source job board software that he extracted from www.jobber.ro (a successful Romanian IT job board).


Mihai Bucica

Mihai Bucica started programming and competing in programming contests (winning many of them), all at age twelve.With a bachelor's degree in computer science from the Automatic Control and Computers Faculty of the Politehnica University of Bucharest, Romania, Bucica works on building communication software with various electronic markets.

Even after working with a multitude of languages and technologies, Bucica's programming language of choice remains C++, and he loves the LGPL word. Mihai also co-authored Beginning PHP 5 and MySQL E-Commerce and he be contacted through his personal website, www.valentinbucica.ro.

Code Downloads

Download the code and support files for this book.


Submit Errata

Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.


Errata

- 10 submitted: last submission 24 Oct 2013

Errata type: Typo | Page number: 22 | Errata date: 10 Aug 06

TIn the code block "if (XmlHttp.status==200)", the third comment has two "the" before "document element". It should be rewritten as "get the text message, which is in the first child of the document element"

 

Errata type: Typo | Page number: 28 | Errata date: 2 April 09

bullet point 3 typo after (it is passed via GET): "The handeServerResponse" should be "handleServerResponse"

 

Errata type: Code Typo | Page number: 41 | Errata date: 29 Aug 06

Load http://localhost/ajax/foundations/css/css.html should be rewritten as Load http://localhost/ajax/foundations/csstest/csstest.html

 

Errata type: Typo | Page number: 43 | Errata date: 25 Jun 09

insert at top "The ActiveX XMLHttp library comes is many more..." should be "... comes in ..."

 

Errata type: Code | Page number: 47 | Errata date: 10 Jun 08

In the method/property box where you provide a quick reference to XMLHttpRequest methods, "Status" should be "status" as implemented on the code on page 50 and onward.

 

Errata type: Typo | Page number: 48 | Errata date: 29 Aug 06

In the first paragraph there is "you will `seed` to set async to true". It should be changed to 'need`.

 

Errata type:Code Typo | Page number: 80 | Errata date: 29 Aug 06

http://www.random.org/cgibin/randnum?num=1&min=1&max=100 should be http://www.random.org/cgi-bin/randnum?num=1&min=1&max=100

 

Errata type: Code Typo | Page number: 91 | Errata date: 04 Sep 06

// using setTimeout and clearTimeout timerId = window.setTimeout("function()", interval_in_milliseconds); window.clearTimeout(timeId); // using setInterval and clearInterval timerId = window.setInterval("function()", interval_in_milliseconds); window.clearInterval(timeId); should read: // using setTimeout and clearTimeout timerId = window.setTimeout("function()", interval_in_milliseconds); window.clearTimeout(timerId); // using setInterval and clearInterval timerId = window.setInterval("function()", interval_in_milliseconds); window.clearInterval(timerId);

 

Errata type:Code Typo | Page number: 214 | Errata date: 07 Sep 06

alert(response.length == 0 ? "Server serror." : response); should be alert(response.length == 0 ? "Server error." : response);

 

Errata type: Technical | Page number: 3 

On thrid page the link provided is http://ajaxphp.packtpub.com
The user can download the code from http://www.packtpub.com/ajax-and-php-building-responsive-web-applications/book

Sample chapters

You can view our sample chapters and prefaces of this title on PacktLib or download sample chapters in PDF format.

Frequently bought together

AJAX and PHP: Building Responsive Web Applications +    Drupal 7 Development by Example Beginner’s Guide =
50% Off
the second eBook
Price for both: $36.00

Buy both these recommended eBooks together and get 50% off the cheapest eBook.

What you will learn from this book

Chapter 1: AJAX and The Future Of Web Applications is an initial incursion into the world of AJAX and the vast possibilities it opens up for web developers and companies, to offer a better experience to their users. In this chapter you’ll also build your first AJAX-enabled web page, which will give you a first look of the component technologies. You can read this chapter in full, for free, here: http://ajaxphp.packtpub.com/1825_01_Final.pdf

View AJAX and the Future of Web Applications Demo: http://ajaxphp.packtpub.com/ajax/quickstart/

Chapter 2: Client-Side Techniques with Smarter JavaScript will guide you through the technologies you"ll use to build AJAX web clients, using JavaScript, DOM, the XMLHttpRequest object, and XML. While not being a complete tutorial for these technologies, you"ll be taken to the right track of using them together to build a solid foundation for your future applications.

Chapter 3: Server-Side Techniques with PHP and MySQL completes the theory foundation by presenting how to create smart servers to interact with your AJAX client. You"ll learn various techniques for implementing common tasks, including handling security and error handling problems.

Chapter 4: AJAX Form Validation guides you through creating a responsive, modern form with real-time validation based on server data. View AJAX Form Validation Demo: http://ajaxphp.packtpub.com/ajax/validate/

Chapter 5: AJAX Chat presents a simple online chat that works exclusively using AJAX code, without Java applets, Flash code, or other specialized library, as most chat applications work these days. Chapter 5 has now been updated to cover JSON. You can read the chapter in full, for free, here:  www.PacktPub.com/files/Ajax_Chat_and_JSON.pdf [PDF - 1 MB]

View AJAX Chat Demo: http://ajaxphp.packtpub.com/ajax/chat/

Chapter 6: AJAX Suggest and Autocomplete builds a Google-suggest like feature, that helps you find PHP functions, and forward you to the official help page for the chosen function. View AJAX Suggest and Autocomplete demo: http://ajaxphp.packtpub.com/ajax/suggest/

Chapter 7: SVG (Scalable Vector Graphics) is a text-based graphics language that can be used to draw shapes and text. (SVG is supported natively by Firefox 1.5, and requires a SVG plugin with other browsers). In this case study you learn how to implement a realtime charting solution with AJAX and SVG. View SVG Demo here: http://ajaxphp.packtpub.com/ajax/svg_chart/

Chapter 8: AJAX Grid teaches you how to build powerful updatable data grid. You"ll learn how to parse XML documents using XSLT to generate the looks of your grid. View AJAX Grid Demo here: http://ajaxphp.packtpub.com/ajax/grid/

Chapter 9: AJAX RSS Reader uses the SimpleXML PHP library, XML and XSLT, to build a simple RSS aggregator. View AJAX RSS Reader Demo here: http://ajaxphp.packtpub.com/ajax/rss_reader/

Chapter 10: AJAX Drag and Drop is a demonstration of using the script.aculo.us framework to build a simple list of elements with drag&drop functionality.

Appendix A: Configuring Your Working Environment teaches you how to install and configure the required software: Apache, PHP, MySQL, phpMyAdmin.

In Detail

Assuming a basic knowledge of PHP, XML, JavaScript and MySQL, this book will help you understand how the heart of AJAX beats and how the constituent technologies work together. After teaching the foundations, the book will walk you through numerous real-world case studies covering tasks you’ll be likely to need for your own applications:

  • Server-enabled form-validation page
  • Online chat collaboration tool
  • Customized type-ahead text entry solution
  • Real-time charting using SVG
  • Database-enabled, editable and customizable data grid
  • RSS aggregator application
  • A server-managed sortable list with drag&drop support using the script.aculo.us JavaScript toolkit


The appendices guide you through installing your working environment, using powerful tools that enable debugging, improving, and profiling your code, working with XSLT and XPath.

From the Author, Cristian Darie
"AJAX and PHP: Building Responsive Web Applications is mainly a book for beginners, but when designing its contents we tried to find the ideal blend of topics that would help both novice and experienced web developers make a big step forward. One customer was very kind to let us know, through a review, that we succeeded:

"The theory behind all the technologies used is very clearly explained, without boring you with details about obvious things. Right from the first chapter you start learning by examples. The examples can be easily adapted to many web projects and they cover stuff that is both useful and fun."

Here are a few examples of such "useful and fun" things that you can find in this book:

 

  • details on using proxy scripts to work around the security measures in modern browsers
  • client-side and server-side code that doesn't break when fed with special characters (such as <, ", etc)
  • code that works efficiently with Internet Explorer 5, 6 and 7, Firefox, Opera, Safari, and others
  • a very quick introduction to SVG, the new rebel kid of the web (and of the house)
  • client-server communication based on message queues that guarantee that your messages aren't lost on the way, and arrive in the intended order at the destination
  • server-side state management techniques that use query string parameters and database records to keep track of your client's activity
  • simple yet effective error-handling structures that combine JavaScript code and PHP code to report when something bad happens on the client or on the server
  • a live errata page that is updated as soon as anyone reports a suggestion or a correction
  • a friendly AJAX tutorial and many case studies that teach you how to use JavaScript, PHP, MySQL and XML together in order to achieve wonderful results

The book's authors and the publisher are listening to your feedback, and appreciate when you invest some time to let them know what you think. The first result of this collaboration is an updated version of the AJAX Chat case study that uses (and teaches) JSON instead of XML. Find this new chapter in the code download or on my website.

Thanks for reading such a long message. Have fun!" Cristian Darie.

AJAX and PHP: Building Responsive Web Applications is the most practical and efficient resource a reader can get to enter the exciting world of AJAX. This book will teach you how to create faster, lighter, better web applications by using the AJAX ingredients technologies to their full potential.

View demos of the case studies in this book here: http://ajaxphp.packtpub.com/

UPDATE: Following suggestions from customers, Packt has updated AJAX and PHP: Building Responsive Web Applications to now cover JSON, a document format that can be used as an alternative to XML. Chapter 5, the AJAX Chat Case Study, now introduces JSON theory and also uses JSON instead of XML in the code.

The updated chapter is free and can be downloaded from: www.PacktPub.com/files/AJAX-Chat-and-JSON.pdf [1 MB]

Approach

Who this book is for

This book is for web developers willing to build better web applications. A basic knowledge of PHP, XML, JavaScript and MySQL, or a strong will to learn-as-you-type, is assumed.

Buy Learning jQuery

 

Code Download and Errata
Packt Anytime, Anywhere
Register Books
Print Upgrades
eBook Downloads
Video Support
Contact Us
Awards Voting Nominations Previous Winners
Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
Resources
Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software