Reading a folder, advanced :(

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!

Moderator: General Moderators

Post Reply
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Reading a folder, advanced :(

Post by nick2 »

Well I really have no idea how to do what I need.

I want to be able to read all the .txt files in my data folder.

and then some how make each txt file into a link you can click to open it.

I am not asking you to write the code just maybe some guide lines on how and what to do!

thanks,
nick 8)
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

These 2 functions will allow you to open and read all the files in a specified directory:

opendir()
readdir()

In fact, there is an example of how to list all the files in a directory on the readdir() page. All you need to do then is add dynamic links with the path /$filesdirectory/$file. Hope this helps.
User avatar
nick2
Forum Contributor
Posts: 118
Joined: Fri Jul 25, 2003 2:34 pm

Post by nick2 »

thx duff just tryn to understand it.. er do both of those go together?

plz help me ;(
Post Reply