Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
for($i = 1; $i <= 11; $i++) { $pcaption = $fr{"caption$i"}; $paction = $fr{"action$i"}; $photo = $fr{"photo$i"}; if($paction eq 'delete') { unlink("../../listing/$ident-$fr{listingi +d}-$i.jpg"); } if($photo ne '') { $photodir = ">../../listing/$ident-$fr{listingid}-$i.jpg"; $fh = $q->upload("photo$i"); open(PFILE, $photodir); while(<$fh>) { print PFILE; } close(PFILE); } $sth = $dbh->prepare("insert into listing_photo values ( '$ident', $ +fr{listingid}, $i, '$pcaption' )"); $sth->execute; $sth->finish; }
2002-05-06 Edit by Corion : Added CODE tags
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with Image Uploads
by Anonymous Monk on May 07, 2002 at 08:20 UTC | |
|
Re: Problem with Image Uploads
by cLive ;-) (Prior) on May 07, 2002 at 00:06 UTC | |
|
Re: Problem with Image Uploads
by rjray (Chaplain) on May 07, 2002 at 06:21 UTC | |
|
Re: Problem with Image Uploads
by Cody Pendant (Prior) on May 07, 2002 at 02:18 UTC | |
|
Re: Problem with Image Uploads
by Anonymous Monk on May 07, 2002 at 00:52 UTC |