I have a textArea in which the conversation from all users will be displayed.
When a user types a message and clicks send button, I want it to be displayed in textArea of all logged in users without use of database/file. I want it to be done using AJAX and PHP only.
function send1()
{
req.open("GET", "process.php?q="+document.getElementById("msg").value, true);
req.send();
}
It would be simpler to use WebSockets, but if you use AJAX, save your sent messages in the DB or a file and organize the client side to read this content every 30 seconds for example, also you should maintain in your db / file only the last 50 messages, if a new message is added, erase the first one. Try to understant how the server and the client side works, then think the model of your application, on paper.