Webbased chat in php without using database or file

前端 未结 14 1040
失恋的感觉
失恋的感觉 2021-02-02 14:49

I am trying to implement a realtime chat application using PHP . Is it possible to do it without using a persistent data storage like database or file . Basically what I need is

14条回答
  •  灰色年华
    2021-02-02 15:36

    If You need to use just PHP, then You can store chat messages in session variables, session could be like object, storing a lot of information. If You can use jQuery then You could just append paragraph to a div after message has been sent, but then if site is refreshed, messages will be gone. Or combining, store messages in session and update that with jQuery and ajax.

提交回复
热议问题