Salve a tutti. Ho trovato uno script in php che mi cancella dei file .jpg vecchi piu' di 20 minuti dal server ftp. In pratica aprendo una pagina php nel server viene avviato questo script che esegue la cancellazione.
Questo il codice:

<?php
// Define the folder to clean
// (keep trailing slashes)
$captchaFolder = 'prova/';
_
// Filetypes to check (you can also use *.*)
$fileTypes = '*.jpg';
_
// Here you can define after how many
// minutes the files should get deleted
$expire_time = 20;
_
// Find all files of the given file type
foreach (glob($captchaFolder . $fileTypes) as $Filename) {
_
// Read file creation time
$FileCreationTime = filectime($Filename);
_
// Calculate file age in seconds
$FileAge = time() - $FileCreationTime;
_
// Is the file older than the given time span?
if ($FileAge > ($expire_time * 60)){
_
// Now do something with the olders files...
_
print "The file $Filename is older than $expire_time minutes\n";
_
// For example deleting files:
//unlink($Filename);
}
_
}
?>

Purtroppo aprendo la pagina che dovrebbe avviare lo script mi appare questo errore (l'ftp e' su altervista):

Parse error: syntax error, unexpected T_VARIABLE in /membri/ftptest/index.php on line 7

Gentilmente qualcuno puo' aiutarmi a farlo funzionare?