I am relatively new to perl, so Please help! perl monk!

I am working on this 'Approve user uploaded pictures' before let it go live, However I also like to move them into each specific gallery while I approve it at the same time

I have to use SELECT HTML array and send selected value(gallery id) as Perl parameter. Now the problem is I am not only sending one picture. I am sending multiple picture into multiple gallery. (can be selected), but I am stuck on PERL function where I have to set each selected value into different item

sub accpending { my $self = shift; #reads the checked list from pending function. my @pids = param('list'); my @selectedparam = param('gallery'); my $i = 0; foreach my $pid (@pids) { my ( $pxml, $pob ) = @$self{'pxml','pob'}; my $item = $pob->find_node( $pxml->{'xml'}, 'item', id => $pid ); # points to gallery my $chosengallery = @selectedparam[$i]; # print "item: $item\n"; #if item cannot be found in pending list, prints this. # if( !$item ) { # WCM::Basic::doheader($self); # print "Item to approve is already gone"; # return; # } # recevie the selected gallery for addtogallery # from approve() function $item->{'_change'} = 1; # change gallery according from seelcted param. $item->{'gallery'} = {value => $chosengallery}; my $node = $self->addtogallery($item, 0); $self->genthumbs ($node); #we want to save it at iob real list to make sure we have the item + in the gallery. $self->{'iob'}->save(); #make sure to delete node from pob, since file has been moved to a +pproval list already. we dont want this picture to keep in our system +. #save the newly updated pending list. #comment out if you want to temporary disable moving from pendingl +ist. #$pob->del_node( $pxml->{'xml'}, 'item', id => $pid ); $pob->save(); $i++; } }

Here is the HTML section.

#new galleryops for choosing gallery my $dgallery = xval $item->{'gallery'}; my $galleryops = $self->gengalleryops( $dgallery ); my $className = ( $i % 2 ) ? 'row t_list' : 'row t_list_alt'; $i++; # List pending images along with checked list $ret .= " <tr class='$className'> <td onmouseout='showPicture(\"$file\",0, \"$path\")' + onmouseover='showPicture(\"$file\",1, \"$path\")'>$file</td> <td onmouseout='showPicture(\"$file\",0, \"$path\")' + onmouseover='showPicture(\"$file\",1, \"$path\")'>$shorttitle</td> <td id='$file'></td> <td>$date</td> <td onmouseout='showPicture(\"$file\",0, \"$path\")' + onmouseover='showPicture(\"$file\",1, \"$path\")'>$desc</td> <td> <select id='curgal' onchange='showgalfields()' name='g +allery[]'> <option value='-1'>Select One</option>$galleryops </select> </td> <td onmouseout='showPicture(\"$file\",0, \"$path\")' + onmouseover='showPicture(\"$file\",1, \"$path\")'>&nbsp;</td> <td><input type='checkbox' name='list' value='$id' s +tyle='float: right;'></td> </tr>"; }

Notice only checked list value need to get approval. But at the same time, it needs to move into USER SELECTED GALLERY

I also need to set if statement if user didn't SELECT gallery, dont approve it

So, Basically I am stuck where I have to make while statement to run array simutaneously, and I need to make if statement to make sure ONLY THE CHECKED VALUE gets approval.

.... HELPPPPP!


In reply to I need a help! regarding with SELECT html with Perl by huchister

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.