I have a file on the filesystem with the following format:
name.jpg}caption1
name2.jpg}caption2
...
nameN.jpg}captionN
if you can guess, it's for an image gallery. Appending new lines on a file
upload process is quite easy with fopen/fput. The trick comes in when I have
multiple, say 10, images listed and now want to delete one or change the
caption.
I am using php.
I can read the file into an array which leaves each line as an element in
the array,
and if I for loop thru it, I can use list to make $filename and $caption
variables.
Display of each in an html form is no problem. I currently have a copy of the
thumbnail image, a text field with the caption and a "delete" checkbox.
The issue is how do I capture the new data for all 10 caption fields and then
edit the config file from earlier? I haven't quite gotten my head wrapped
around
multidimensional arrays, or even if they are appropriate for this. I think
I have
over thought it, so I am turning to others for a bit of inspiration.
--
fix.er \'fik-s*r\ n : one that fixes : as : one that intervenes to
enable a person to circumvent the law or obtain a political
favor : one that adjusts matters or disputes by negotiation
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!