$files is empty - nowhere in your while loop do you add any data to it.
My guess is your question is really 'Why are my images displayed in the same
order as the directory?'. This is because you're displaying them at the same
time as reading the dir. To randomise the order, add all the file names
Steven Macintyre wrote:
I have the following;
$files = array();
$curimage=0;
if($handle = opendir($dirname)) {
while(false !== ($file = readdir($handle))){
if(eregi($pattern, $file)){
$filedate=date ("M d, Y H:i:s",
filemtime($file))
2 matches
Mail list logo