PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I'm trying to write a while loop that will test first whether a file exists for previous months, and if so display a link to it, but for some reason I get an extra link...It seems to be going through the loop an extra time. Can someone tell me what I'm doing wrong?
Thanks for the help, but the code posted doesn't seem to do what I want either.
I tried just that code, and with that I end up with a never ending list of months.
I also tried taking putting the while loop that I have into the if statement that you used, but I still just get the same list that I got, i.e. I have files for March through July, but the code lists February as well. If I add a February file, then the list will show January, etc.
You are doing it backwards within the loop, you check whether the previous file exists, then you change it to the next filename and show the link. This will make it so that the last one is always a bad link.