function update() {
$.ajax({
url: 'update.php', //php
data: "", //the data "caller=name1&&callee=name2"
dataType: 'json', //data format
success: function (data) {
//on receive of reply
var foobar = data[2]; //foobar
$('#verification').html("(<b>" + foobar + "</b>)"); //output to html
}
});
}
$(document).ready(update); // Call on page load
setInterval(update, 5000); //every5 secs
Nov 12, 2022
8
Level 1
How to run PHP script every 5 seconds?
How to run vanilla PHP script every 5 seconds? (only one instance of this script can be run at the time) So ideally run script 5 seconds from the time script stopped last time.
I have my own Ubuntu server.
Please or to participate in this conversation.