Logic of PHP based chat application like Google Talk

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mujeeb i
    New Member
    • Jul 2012
    • 7

    #1

    Logic of PHP based chat application like Google Talk

    Please somebody know what is the logic of chat like google tlak..?
    please tell me how to write chating code for php..with example...
  • ariful alam
    New Member
    • Jan 2011
    • 185

    #2
    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.

    Comment

    • mujeeb i
      New Member
      • Jul 2012
      • 7

      #3
      what is the key value of enter key ?

      Comment

      • ariful alam
        New Member
        • Jan 2011
        • 185

        #4
        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

        Working...