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.

3 Responses to “where can I found PHP or JavaScript function to execute a statement every specific amount of time ?”

  1. lansingstudent09101 Says:

    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 :

  2. Nikki Says:

    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 :

  3. Roger Rabbits Clone Says:

    w3schools.com
    References :

Leave a Reply