Say this is the situation:
log010104
log020104
log030104
Everyday it will generate a log file using the current system date. All files end with the txt extension.
Say today is 040104.
I would like to allow the user to select the files to be viewed for the past three days. But it would be funny to hard code the strings for the filename.
If I do this, that means everyday I would need to modify the PHP code so that the user can view the previous log fies.
Is there a better way to do this?
What I hope to do is: a PHP script will read that directory, get the number of files available, read each filename and put into a variable, generate the list of files that can be viewed through a link. The user needs to just click on the link to view the contents of the file. I was thinking that all these could be done via a while loop but not sure how to start.
Hope you get the picture.
Hope someone can help me out here.