Programming a Chatroom, where to start?

John picture John · May 29, 2011 · Viewed 9.3k times · Source

I want to create a chatroom, but I am not entirely sure where to start.

I have programming experience in C and Java, and I am willing to learn. I would like to use either html5 or php, but this may not be correct.

If any one can point me to the right direction that would be great.

Thanks

Answer

Sam152 picture Sam152 · May 29, 2011

You need to have a good understanding of server and client side technologies to make a full featured chat client. It's quite challenging, especially for a first time project. Some of the things you might need to use are:

  • PHP for handling the communication between the browser and the server, taking the users input, parsing it and saving it.
  • MySQL for storing chat records between users, keeping track of who has said what at which times.
  • JavaScript and AJAX for enabling the clients browser to display latest chat records, polling the server for the latest chat records, sending a users chat records to the server.

It's not a trivial project, it took me years to learn these different languages enough to be able to create a secure and usable chat client. I would recommend something easier for a first time project.

There are many open source chat clients for PHP out there. AJAX chat is a good one as is PHPSimpleChat.