What if you do use file_exists()? and then if it exists, do something else with the name,
i think having totally random numbers is difficult because 1 faulty character messes up the whole system,,,
well i really don't know, i'd use file_exists()
btw, this is my own script ,, i made it before i saw this, so i don't know if it's any use for you guys...
CODE
if(is_dir("../photos/Thumbs/".$folderloads)){
if(file_exists("../photos/Thumbs/".$folderloads."/".$photos[$num])){
$num++;
$nextimg = "<script type='text/javascript'>location.href='[[SITE]]/[[FOLDER]]/makeimg.php?num=".$num."&folder=".$folderloads."'</script>";
echo $nextimg;
}else{
$save = $photos[$num];
$file = "../photos/".$folderloads."/".$photos[$num];
$view = makeimage($file, $save, "../photos/Thumbs/".$folderloads."/", $size, $size);
echo "<img src='".$view."' alt'".$photos[$num]."' /><br />";
echo "<br />";
$num++;
}
}else{
mkdir("../photos/Thumbs/".$folderloads , 0766);
$save = $photos[$num];
$file = "../photos/".$folderloads."/".$photos[$num];
$view = makeimage($file, $save, "../photos/Thumbs/".$folderloads."/", $size, $size);
echo "<img src='".$view."' alt'".$photos[$num]."' /><br />";
echo "<br />";
$num++;
}
$folderloads is the variable taken for the name of the album, where every album is in a seperate folder.
$photos is an array containing the scandir of $folderloads
well, yeah, owyeah the makeimage() function just creates thumbnails of 250x250;) not so important for this question i guess
IU actually think this is just a pointer, and you propably know what to do already, but this is what i thought of