The main trouble with this is that it's extremely hard to find out what images exist, especially since you have imags of multiple formats, unless you are storing them in a textfile or database once submitted. If you are storing them in a database, it's easy. Just have all the images get uploaded into a single folder and add a TIMESTAMP field. Then, you can use a script that gathers all entries in the database past a certain date (five days ago). The sql would be something like
Code: Select all
"select * from images where date>now()+432000"
Just a suggestion, if it doesn't work, there's alternatives.
BTW, is there only gonna be one image per day? if not, wouldn't the image names be "img01_05_12.jpg"? If so, then you could use a while loop.
Code: Select all
$d=mktime();$file_types=array("jpg","gif","png"); //etc.
for($num=0; $n<5; $num++) {
for($x=0;$x<count($file_types);$x++) { //You might use foreach() if you have PHP4
$file="img_".date("d-m",$d).".".$file_typesї$x];
if (file_exists($file)) echo '<img src="'.$file.'">';
}
$d=$d-86400; //subtract a day
}