Jump to content

cron timer


mandukar

Recommended Posts

hi can someone do me a favor and see whats wrong with this script.

i'm trying to get it to reset people's accounts every few hrs however it doesn't seem to want to work..

theres one for 2hrs and another 24 hrs..

[tt]
<?php
// Enter the number of hours below.

$hours1 = 2;
$hours2 = 24;

//Hours calculation

$hours1 = $hours1*3600;
$hours2 = $hours2*3600;

$cron_timer = mysql_fetch_array(mysql_query
("select * from cron_timer where id=1"));

// Timer for 24 hours
if ($stat[lpv] > $cron_timer[lpv]) {
include("reset.php");
mysql_query("update cron_timer set lpv=lpv+$hours1 where id=1");
}

//End of 24 hour timer

$cron_timer = mysql_fetch_array(mysql_query
("select * from cron_timer where id=2"));

// Timer for 2 hour timer
if ($stat[lpv] > $cron_timer [lpv]) {
include("reset.php");
mysql_query("update cron_timer set lpv=lpv+$hours2 where id=2");
}

//End of 2 hour timer
?>
[/tt]
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.