How do I make a set of code run every ten minutes in PHP?

Cully W

New member
Every ten minutes, I want my information to update. I know the formulas, but not how to make it happen every ten minutes and every midnight. Ideas?
 
In order to have a script run without user interaction, you must have access to the server to set up a cronjob, or other similar functionality. This can't be done with a normal PHP script that generates a web page.

You could simulate this by storing a time stamp in a table of the last run of your script, then every page load check to see if ten minutes have elapsed. The problem with this is that it will only run if people are actually visiting your website.
 
Back
Top