Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Help with Flat File Database Image Gallery
January 10, 2005, 3:37 am
rate this thread
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
<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!