I have a directory with files like such:
1-0.html
1-1.html
1-2.html
1-3.html
2-0.html
2-1.html
3-0.html
4-0.html
4-1.html
i want to make a page that will generate links to those. for example if a person is reading file 1-0.html, the links will display all the links for 1-0 to 1-3, but not show the other links.
currently I'm doing it by hand, but since I'm learning php, i thought there would be a way to do it with variables. :-)
is there a way to do that? or is there a better way for naming hierarchy to achieve a more or less automated result? if automated, is there also a way to change the css class of the current page? like the active page will be a gray color and non active link whereas the other links will be the regular link color?
Thanks.
update:
I found this: http://www.liamdelahunty.com/tips/ph..._directory.php it shows how to list files in a directory, but it seems to list everything in a directory. how can i do something similar but just to list certain files?
Thanks again.
Last edited by ShadowHawk; 01-15-2011 at 10:44 AM..
Reason: updated.
|