Help with Flat File Database Image Gallery

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I don't have a database available, so i'm writing an Image Gallery with
a flat file database.

I have an Add Page:
Uploads Image file, and saves $filename and $caption to text file:

Captions.txt is in format:
photofilename.jpg|caption to do with photo here.

I can easily read out each individual part from the captions.txt file to
display the photo and caption on a display page. I also have a delete
file that unlinks the photo, using the info in the captions.txt file,
but i can't figure out how to remove the entire line from the database
file based on the filename...??? Basically I want to click on an image
like this:
<a href=delete.php?filename=phototodelete.jpg> and have the delete.php
file unlink the picture, and then erase the line in the text file, that
begins with the filename (phototodelete.jpg).

I guess i need to search through the data file and when i match the
filename, erase the line... I'd appreciate any help with that!

Re: Help with Flat File Database Image Gallery

matt wrote:
Quoted text here. Click to load it

The following might give you an idea:


Site Timeline