Hi guys,
I've been struggling with this one for a whjile now.....
I have a few functions that need to be run at specific times, the primary one is a function that expires a persons membership in a mysql database (just changes their status from 1 to 0), the functions are not the problem, its getting them to perform by themselves at the date and time specified.
for example, expireMembership() needs to run at 10pm on the last day of the month. I have used mktime to get the last day of the month. I can get it to work when the page calling the function is refreshed (i'm not using the $lastday variable while testing, I'm using $today). It needs to be automated so that it just runs on the specified time necesarry. Heres $lastday:
<?
$next_month = date("m", strtotime("+1 month"));
$this_year = date("Y");
$lastday = mktime(22, 00, 0, $next_month, 0, $this_year);
?>
The other option would be to have a form activate the function manually, but i wanted to try and take away any human intervention.
Is it possible??
Any help with this would be awsome!
cheers
Mark