One of the most popular uses for the Internet is person-to-person communication. There are many ways that we can communicate with each other online including ICQ, MSN Messenger, forums, Email, mIRC and Java chat applets. If you run a web site, then you should provide your visitors with some sort of communication tool that will allow them to express their opinions on a particular topic, as well as communicate with other people sharing the same interests as them.
In this article, Im going to show you how to create a quick-n-easy chat script using PHP and a very simple MySQL database. The script will run in a web browser and the chats will be stored in a database. Our script will allow the visitor to choose a nickname, enter text to send to the chatting window, and view messages from other people all in real-time! For a bit of fun, our chat application will also have buttons to send several emote-icons including smiling and frowning faces.
In this article, I am assuming that you know how to create a MySQL database from the command line. I will also assume that you have Apache, PHP and MySQL on the same server running under Windows 2000. If youre running a Win9x/Unix box, dont worryeverything is pretty much the same.
Firstly, lets start by creating the database to store our chat sessions