There is a php chat program which you can set up for your site under your cpanel (I believe it's called phpmychat). I've used this before and was quite impressed, although there were a few things i didn't like about it, the disadvantages below are what i didn't like the most.
The script can be found under the pre-installed scripts section.
However, using php for a chat room has disadvantages in that the only way you can really update pages is to keep refreshing the page to get the latest chat from the database or file. This means that the script is not bandwidth friendly and you may find that you run out of bandwidth quite quickly.
I advise using a language such as Java or Flash to have a chat room that is updated in real time and which is less stress on your bandwidth/database.
Unfortunately, I'm not good enough on these languages to tell you how to do it or to provide an example code, however, a google search should help. There's many chat scripts out there which you can use in java/flash which allows more of a live script than php.
Hope this helps :-)
Comment/Reply (w/o sign-up)