Display information from the user in the CP?

Hello, in General, are faced with the problem, on my website there are authorization and user registration, as is my admin page where I see all users. The user sends the message to me, I would have to check(Pass moderation), after I checked the information written to the users I click on "Yes" or "No", and after pressing him in LK should come a message indicating whether it was information or not, so it wouldn't reload the page, ie how Bhutto in live time.
Read about soket, etc , but I need to figure out how to do it using ajax and php.
I will be glad for any hint how this can be done!
The local website I have is((
March 23rd 20 at 19:18
1 answer
March 23rd 20 at 19:20
If not WebSocket, then only periodic polling of the server. Put in a JS interval and fires it sends an AJAX request to the server. Then show the server response to the user.
Thank you for your reply, and tell how the repeated queries will load the server?
Or it's not so bad, if I for example answer will be 5 minutes for example the user - Maryjane.OConner commented on March 23rd 20 at 19:23
@Maryjane.OConner, And it all depends on the server implementation. A simple query "is there any new events for the user in the last five minutes of" special loads should not give and work will in a split second.
In the interval, see for yourself if your users are satisfied with the interval of five minutes, ask every five minutes. Hurry - make the queries more often. - Aryanna commented on March 23rd 20 at 19:26
@Aryanna, Thank you for the explanation of the essence of the work realized) - Maryjane.OConner commented on March 23rd 20 at 19:29

Find more questions by tags JavaScriptPHPAJAX