nathan1 Posted October 28, 2008 Share Posted October 28, 2008 Hi Guys, I have a general question on how i would go about setting php with time recurrence. I have a event type of setup and i want to be able to add in recurrence, for example instead of setting the start and finish time of the event, i want to add in the option "every week", or once a week etc... just wondering how i would tackle this problem, appreciate any ideas, cheers Link to comment https://forums.phpfreaks.com/topic/130362-solved-php-with-time-recurrence/ Share on other sites More sharing options...
bobbinsbro Posted October 28, 2008 Share Posted October 28, 2008 i'm not sure i understood. do you mean you want to use schedule a task to run a php file on the server? Link to comment https://forums.phpfreaks.com/topic/130362-solved-php-with-time-recurrence/#findComment-676227 Share on other sites More sharing options...
Stephen Posted October 28, 2008 Share Posted October 28, 2008 Hi Guys, I have a general question on how i would go about setting php with time recurrence. I have a event type of setup and i want to be able to add in recurrence, for example instead of setting the start and finish time of the event, i want to add in the option "every week", or once a week etc... just wondering how i would tackle this problem, appreciate any ideas, cheers Well you can use cron jobs to keep running it every say week. The closest php script (instead of cron) to do it would probably look something like: <?php set_time_out(0); ignore_user_abort(true); $_vew["config"]["days"] = 0; $_vew["config"]["hours"] = 0; $_vew["config"]["minutes"] = 5; $_vew["config"]["seconds"] = 5; $_vew["time"]["total"] = $_vew["config"]["seconds"] + ($_vew["config"]["minutes"]*60) + (($_vew["config"]["hours"]*60)*60) + ((($_vew["config"]["days"]*24)*60)*60); do { //execute code to do every <x> time sleep($_vew["time"]["total"]); } while (true); ?> Haven't tested though. Link to comment https://forums.phpfreaks.com/topic/130362-solved-php-with-time-recurrence/#findComment-676238 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.