How can i run or refresh PHP page every 10 Minutes or an hour. so that add new record from one database to another i doesn't matter with using javascript
but without using cron jobs
.
You can depend on the traffic to your website if it's frequent enough. Drupal has something called poor man's cron. Basically you store the date-time that the cron job was last run. Each time a user visits a page on your website, you fetch the date-time, compare it with the current date-time to see if you need to run the cron job (in your case, see if an hour has passed). If the required amount of time has passed, then run your cron job, and store a new date-time. If your required amount of time hasn't passed, then do nothing.
This approach has a few caveats.
with javascript you can use the setTimeout() function but the user will need to keep the page opened.
ie
setTimeout(function(){ your_process(); }, 360000); // every hour
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.