This document describes how to install the sample AJAX Driven Chat application on your local machine. To find detailed information on how this application works please visit: http://www.dynamicajax.com/fr/AJAX_Driven_Web_Chat-271_290_291.html
You can also download the code for this application there.
All code is provided AS-IS. This code is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. You may use this code in your own applications, but I would love it if you would provide a link back to http://www.DynamicAJAX.com so that others can find my site and hopefully make use of this code and tutorial.
You should have recieved this file in a ZIP that contains all the necessary files to run the Chat application on you machine. If you do not have any of the files listed below, you can download the tutorial from Dynamic AJAX
Installing the Dynamic Chat application is pretty straight forward. The only piece that requires any effort is setting up the database. If you have
any expirence with using MySQL on the web, this should be extreamly easy. You can either create a new database, or use an existing database for the Chat
application. If you are using an existing database for the chat application, simply run the chat.sql script on your database to create the database tables.
Do this either in your favorite MySQL tool, or through the MySQL command prompt with:
source c:\path to chat\chat.sql
If you are creating a new database for the chat application, create a new database with:
CREATE DATABASE chat;
Be sure to grant access to the chat database. This code requires the old password format for PHP to be able to connect to MySQL.
GRANT ALL ON chat.* TO myLogin IDENTIFIED BY 'myPassword'; USE mysql; UPDATE user SET password = old_password('myPassword') WHERE user = 'myLogin'; FLUSH PRIVILEGES; COMMIT;
Once you have created the database tables all that is left is to set the correct connection information in database.php
function db_connect($server = 'your server', $username = 'your db user name', $password = 'your db password', $database = 'your database name', $link = 'db_link') {
You can now simply place chat.html, database.php, and getChat.php into one of your websites directory and browse to chat.html.
Open up two different browser instances to see the Chat Application in action!
Hopefully this tutorial will give you a good introduction to AJAX technologies. If you have any questions or comments about this application, please write me at rsmith@nthcs.com, and visit http://www.DynamicAJAX.com for updates to the tutorial and other great AJAX resources.