in reply to Re: Re: Multiple Check boxes and Handling
in thread Multiple Check boxes and Handling
They are in separate variables in the @deletes array.
$deletes[0] # contains first $oid to delete $deletes[1] # contains second $oid to delete ... $deletes[n] # contains n+1 th .....
Here is how you use your array. Assunimg that $oid contains a filepath to a file you want to delete this will do that.
<code> #/usr/bin/perl -w use CGI; use CGI::Carp('fatalsToBrowser'); use strict; my $q = new CGI; my @deletes = $q->param('delete_this_value'); print "Content-type: text/plain"; foreach my $oid (@deletes) { # you get the value of $oid here for all checked boxes &do_delete($oid); } sub do_delete { my $oid_to_delete = shift; unlink $oid_to_delete or die "Can't unlink $oid $!\n"; print "Deleted $oid_to_delete\n"; }
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: Multiple Check boxes and Handling
by nlafferty (Scribe) on Oct 08, 2001 at 18:44 UTC | |
by tachyon (Chancellor) on Oct 09, 2001 at 00:57 UTC |