in reply to checkbox name processing

If I understand the problem correctly what you are trying
to do is when the submit button is hit is to find the filenames
of the files that have been checked
In the following piece of code, when the submit button is hit
the array @files will contain the names of the files checked and the
string 'submit'
#!/usr/bin/perl -w use CGI; $page = new CGI; print $page->header(); print $page->start_html(); if ($page->param('submit')) { @files = grep {defined CGI::param($_) or CGI::param($_) ne ''} CGI +::param(); print @files; exit; } print $page->startform(); @latest = qw(one two three); foreach $fname(@latest) { print qq($fname <input type='checkbox' name='$fname' value='$fname +'>); print qq(<br>\n); } print qq(<input type='submit' name='submit' value='Submit'); print $page->endform(); print $page->end_html();
Hope this helps

Replies are listed 'Best First'.
RE: Re: checkbox name processing
by vrempire (Sexton) on Aug 09, 2000 at 12:58 UTC
    Thanks for your reply,I really appreciate it.So,for the array @files,is the array also being send to the next cgi file to process when the submit button is clicked,or is the array @files is still inside the current cgi file? I prefer that the @files can be send also to the next cgi file,so I can process it inside the new one. Thanks again.