Jump to content

Scheduled actions using page reload


1bigbear

Recommended Posts

I have to build a script that will perform a certain actions at specified intervals, and I don't know how to do it.

I have a list of events something like her:

walk     every  30 minutes
run       every 10 minutes
talk      once a day
sit         once a week

 

I have four actions that need to be performed at different intervals, I have in a database the time when  the task was last performed, the interval, and the future time when the action must be performed.

 

Because I can't use cron I am thinking of using a page that reloads every 1 minute as the clock to compare the actual time with the all tasks future time, if they are equal or future time is lower that the actual time then perform the task.

 

What do you think is this a good method or there are more simple ways of doing this?

Link to comment
Share on other sites

if u are doing 1 by 1

like all those actions a user perform, and wont affect others, then just use javascript, with ajax, or meta reload

if one master user perform t hose action, and affect all others, and if u are using virtual server, or delicate server (anything that u have access to system root), u can set up a page for your self only, have that virtual server refresh it once a while

using http://localhost/action.php?act=somethingsomething

in this action page, u have <meta refresh=86400 /> <!--86400=seconds in a day-->

if u dont have access to system root, and dont want to do this

dont want to do this -->>when a user request, it update all stuff according to time, and calculation

then u must do this, ask all your administrators, and your self, to load your page in that amount of time, with meta tag (u dont need to do it by your self, just open the browser, let it refresh automatically

dotn worry, if u have alot of admin to do it, just check whether it is time to do so, and  1 of them will do it, others just display error message, with meta tag there also

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.