|
Posted by Steel on 01/20/06 15:41
"Pedro Graca"
kindly wrote:
> clearstatcache();
> $origtime = getdate(filemtime($FileName));
> $newtime = mktime(0, 0, 0, $origtime['mon'], 1+$origtime['mday'],
$origtime['year']);
>
> ### answer the questions above and either uncomment or remove the
> ### following line
> // $newtime += 24*60*60;
>
> touch($FileName, $newtime);
>
>
> You may have some problems when DST starts/ends. Perhaps you can use
> gmmktime() instead.
>
> --
Well,
Thank you
At last my full script is:
<?php
$FileName = 'sem.txt';
clearstatcache();
$origtime = getdate(filemtime($FileName));
$Today=strtotime("now")
if $Today>$origtime
{
$newtime = mktime(2, 0, 0, $origtime['mon'],
1+$origtime['mday'],$origtime['year']);
touch($FileName, $newtime);
if ($handle = opendir('./cgi-bin/sessions')) {
while (false !== ($file = readdir($handle))) {
if ($file != "." && $file != "..")
{unlink("./cgi-bin/sessions/" . $file);}
}
closedir($handle);
}
}
?>
My script try to delete all temporany files if user date is up the last
modified date of the file sem.txt
After it try to update the last modified date of the sem.txt adding 24
hours.
I'ld like very much to knoe if there are errors?
Thank in advance
Steel
Navigation:
[Reply to this message]
|