Jump to content

[SOLVED] Php with time recurrence


nathan1

Recommended Posts

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

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.