Jump to content

Read txt file and pass each line as variable in a function


tonysparks

Recommended Posts

I'm designing a website that is update several times a week with a new gallery of images.

 

Each set of images is stored in it's own directory with a page that generates a gallery and textually describes the images in the directory. I want to create a page that reads from a list of the image directories and dynamically generates a link to each gallerey, 10 to a page.

 

something like this:

 

directorylist.txt

 

index.php reads directorylist.txt, places the first gallery listed at the top of the page, then 9 more links to the next 9 galleries. At the bottom of this page, links to the pages that contain galleries 11-20, 21-30, etc.

 

I have already created functions that take the gallery ID and generate the links, I just can't seem to figure out how to read from the text file, then generate the links in my main pages

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.