Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

forece refresh client page from server side [closed]

How may I refresh current client view page from the server side? for example, if I want to force refresh for page that is viewing now for all the clients, so they can view the new content. and I want to do this refresh in the time that I want using PHP.

Is it possible??

like image 594
Naji Shmly Avatar asked Feb 16 '23 16:02

Naji Shmly


1 Answers

You can get the behavior in two ways:

WebSockets - If all your clients connect via web sockets, you have a direct connection between the client and the server. You'll need to get creative with timing, but you can certainly send a command at any time requiring a refresh. This requires that you implement web sockets in PHP http://socketo.me/ and JavaScript.

Polling - You can set up the client to send an AJAX request every x seconds. The server responds with a bool value which the AJAX success handler uses to determine whether it should refresh the page.

like image 164
Chris Hanson Avatar answered Mar 04 '23 05:03

Chris Hanson