I have an image on http://photo.danen.org (the 500x375 one) that I want to change randomly. Right now it is hardcoded to /intro/today.jpg. All images are 500x375 .jpg files, but the file names can be anything.
I would like a routine that checks the /intro directory to see how many files there are, picks a random number in that range and then selects the nth file for display.
Has anybody developed such a routine, or does anybody have a better way to approach this?