You can use database to develop chat application. you need to create a few tables for chat application to check users online or not and to store chat texts in database. chat text table may contain from_user, to_user, chat_text.
in interface you can use ajax in setTimeout() function of javaScript to check the chat_text using php from database server and show the text in specific user's chat window.
suppose, A and B are chatting. In A's window there will be a chat window using a DIV tag named B_chat. so, you have to query "select chat_text from chat_table where (from='A' or from='B') and (to='A' or to='B') and chat_date=getda te()" in database using ajax from server side script. this may return all the chat text between A and B on current date. And you have to write those in B_chat DIV using innerHTML/innerText.
Comment