Display result without loading/refreshing the page using php,mysql,html,javascript

I'm using php(insert.php) to store/insert data in mysql.

I'm also using another php file(display.php) to display the result.

I'd like to ask , every time when I insert, how can show the inserted data of insert.php to display.php without loading/ refreshing display.php immediately.


1 answer

  • answered 2020-02-16 14:34 Sergei Martianov

    Use AJAX or Fetch API. On display.php in setInverval() once in few milliseconds send a request to the server. Also you can realize long polling via AJAX or Fetch API.