Depeding on the filenames you are using, and how attached to them you are, you could just stick the date at the beginning of each file.
ex. 2003-09-13bike.jpg
Then write a script that would go through and take
substr($filename,0,10)
and if that is more than 30 days away delete it.
Set up a cron job to run this script every day, or if you don't have access, run it yourself, or include it in a page that gets a lot of visitors.
This little snippet should do what you need for calling the images in the directory, and deleting them. Might need a few modifications, I just threw it together.
<?
// path/to/images is the full unix path. Ex. /home/httpd/vhosts/domain.com/httpdocs/pictures
$todaysdate = time();
$handle=opendir('/path/to/images');
while (false!==($file = readdir($handle)))
{
if ($file != "." && $file != ".." && $file != "index.php")
{
$filedate = strtotime ("substr($file,0,10)");
$thirtydays = 86,400 * 30;
$diff = $todaysdate - $filedate
if ($diff >= $thirtydays)
{
exec("rm -f /path/to/images/$file");
}
}
}
closedir($handle);
?>
This is pretty much untested, I just through it together, and I'm a little rusty working with timestamps, so you might need to read the manual with that, but otherwise this should start you in the right direction.
Hope it helps!
JAKE