Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have the following mysql tables
Products table ============== id name price ...etc images table ============== img_id prod_id img_ext
So when adding products I can add as many images as I want (for now 3 only), but the idea is to leave the number dynamic.
The problem is when editing the product I want to be able to replace already uploaded images OR upload some other new images
the idea I had was using the img_id inside the field names like this
<input type="file" name="img[$img_id]">
So if I have an img with an id I'll update the image record otherwise, it's a new image so I'll insert a new record.
I cannot seem to get CGI module to fetch this html input as key,value pairs.
Any idea or new logic would be appreciated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: fetch html input as hash
by merlyn (Sage) on Dec 25, 2009 at 14:30 UTC | |
|
Re: fetch html input as hash
by Anonymous Monk on Dec 25, 2009 at 14:34 UTC |