where can I found PHP or JavaScript function to execute a statement every specific amount of time ?
February 10, 2010 - 7:07 am
Hi all
where can I found PHP or JavaScript function to execute a statement every specific amount of time ?
for example :
i need to execute a specific function every 30 minuites (like update a DB with a time dependent specific statement ) .. how can i do it ?
thanks
depends. The IDEAL way to handle this would be:
cron
which is its own binary on *NIX systems. I don’t want to presume anything about your system though.
With cron, everything would be done on the server and you wouldn’t need to for example leave a window open executing things.
In PHP, all processing occurs before a response to an HTTP request is sent, so you would need both a PHP page that did the processing and a javascript to call it. This is generally done with AJAX.
February 10th, 2010 at 12:13 pm
depends. The IDEAL way to handle this would be:
cron
which is its own binary on *NIX systems. I don’t want to presume anything about your system though.
With cron, everything would be done on the server and you wouldn’t need to for example leave a window open executing things.
In PHP, all processing occurs before a response to an HTTP request is sent, so you would need both a PHP page that did the processing and a javascript to call it. This is generally done with AJAX.
References :
February 10th, 2010 at 12:33 pm
You can see if there is a time function in javascript. Not too sure on php since I haven’t learned php yet.
You can always make a macro
References :
February 10th, 2010 at 12:53 pm
w3schools.com
References :