Loading ...
Sorry, an error occurred while loading the content.

Chat application with PHP question

Expand Messages
  • thisistrinath
    Hi, I want to build a chat application. Initially I thought of not using a database and directly send it from client1 to script(at server) via AJAX and back to
    Message 1 of 1 , Jan 15, 2008
    • 0 Attachment
      Hi, I want to build a chat application. Initially I thought of not
      using a database and directly send it from client1 to script(at
      server) via AJAX and back to client2. But I cannot do it as of now
      because using AJAX, server cannot push content onto client as of now.
      But I did search and found that they call it Reverse AJAX (the next
      big thing in the development )
      http://en.wikipedia.org/wiki/Reverse_Ajax and COMET is a method
      achieving the same. So, I will postpone the idea of not using database
      for a while(I hope you found that informational).

      But now I have a question on how to retrieve new messages from
      database, on what basis? Do I have keep contacting the server
      often(say 1 sec) and check for new messages or what else do I have to
      do? How do other chat services like yahoo (in browser) manage to do
      it? The other question is that how do I notify user1 when user2 has
      just entered a message for user1? (This is just like the Gtalk in
      gmail, when someone enters a message it shows up, how does that
      happen?) Any tricks? Please answer me, I am working on building this
      application.
    Your message has been successfully submitted and would be delivered to recipients shortly.