sorry, I am NEW to this.
What you said doesn't mean anything to me.
Mind elaborating?
Thanks!
Sorry— I assumed you meant you'd written the PHP script. There are many ways of doing what you want to do, in PHP or with some other language/tool.
Depending on how your PHP script works, my suggestion might not even work. Open a
copy in your favourite text editor and see if it has an 'fopen' command in it.
My thought was that somewhere, the PHP script will open the appropriate .dat file for appending (new stuff written at the end), with an
fopen( 'foo.dat', 'a') command:
PHP:
<?php
// this is a comment
// rest of programme
$file = 'foo.dat';
// rest of programme
$fileHandle = fopen($file, 'a');
//programme writes writes writes data and closes file
And instead did something like this, using
file_exists() and
filemtime():
PHP:
<?php
// this is a comment
// rest of programme
$file = 'foo.dat';
define('MAX_AGE', 7*24*60*60); //allowable age of file, in seconds
// rest of programme
if( fileexists($file) && (date('Ymdhis', filemtime($file) < date('Ymdhis', time() - MAX_AGE)) ) {
//nukes existing file if it exists and is too old
$fileHandle = fopen($file, 'w');
} else {
$fileHandle = fopen($file, 'a');
}
//programme writes writes writes data and closes file
The above works exactly the same, except if the file is too old, in which case it's overwritten with the new information.