Introduction
Creating a chat application is not a difficult task. Honest!
This tutorial is a step by step introduction to creating a lightweight chat application using XML as a storage medium. As personal motivation, I develop PHP games as a hobby. In pursuit of that hobby I've found that offering a flat threadless forum in such games tends to result in heavy usage as players attempt to use it as a chat room. The reason is that even with the advent of irc and instant messengers, users continue see an alternative web based solution as attractive for a number of reasons whether its limited access to instant messengers through a corporate proxy or simply for convenience sake.
You can download the current version of the source code for this application from: chat.tar.gz or chat.zip. This will be the final version of the code after finishing the tutorial (plus any subsequent patches).
To create this application, I'll be using standard third party libraries. I have no intention of creating new solutions for tasks which are already well covered by a range of excellent libraries. A lot of unnecessary work can be blamed on the "Not Made Here" mentality, so let's not subscribe to that mentality.
On the server side I will be utilising the Zend Framework 0.20 (released 31 October 2006). On the client side, AJAX and Javascript processing will be simplified by using the Prototype library. Should any visual effects be required, I will use Scriptaculous. Proponents of alternate solutions like jQuery, Dojo or any number of others can apply the same principles using their preferred libraries as they wish.