I have a cgi script as below
-------------------------------------------------------------------------
#!/usr/bin/perl -w
push(@INC,'c:\program files/apache group/apache/cgi-bin');
use testapi;
my $webapp = testapi->new();
$webapp->run();
--------------------------------------------------------------------------
The testapi.pm is as below:
--------------------------------------------------------------------------
package testapi;
use base 'CGI::Application';
use strict;
sub setup {
my $self = shift;
$self->start_mode('mode1');
$self->run_modes(
'mode1' => 'showapps',
'mode2' => 'showyear',
'mode3' => 'showdates',
'mode4' => 'showdetails'
);
}
sub teardown {
my $self = shift;
}
sub showapps {
my $self = shift;
# Get CGI query object
my $q = $self->query();
my $val = "";
my $startloc="e:/it support services/db
architecture/sybase/sysmon-webdb";
opendir(SMD,"$startloc") || die "Failed to open Sysmon DB";
my $c=0;
my @apps;
while (my $dir = readdir(SMD))
{
$apps[$c] = $dir;
$c++;
}
closedir(SMD);
for (my $i = 2; $i < $c; $i++ ) {
$val .= $apps[$i];
if($i < $c-1)
{
$val .= ",";
}
}
my $output = '';
$output .= $q->start_html(-title => 'Sysmon Database');
$output .= $q->start_form();
$output .= $q->scrolling_list(-name=> '@apps', -values=>'$val');
$output .= $q->hidden(-name => 'rm', -value => 'mode2');
$output .= $q->submit();
$output .= $q->end_form();
$output .= $q->end_html();
return $output;
}
sub showlist {
my $self = shift;
# Get CGI query object
my $q = $self->query();
my $testcode = $q->param("testcode");
my $output = '';
$output .= $q->start_html(-title => 'List of Matching tests');
$output .= $q->end_html();
return $output;
}
sub showdetail {
my $self = shift;
# Get CGI query object
my $q = $self->query();
my $testid = $q->param("testid");
my $output = '';
$output .= $q->start_html(-title => 'test Detail');
$output .= $q->end_html();
return $output;
}
1;
-----------------------------------------------------------------------
When the script is executed it sends the actual variables in the HTML as
opposed to the values in the variable as in the output below. How do I get
the alctual values from the variables passed in the HTML??
** <select name="@apps" size="1">
** <option value="$val">$val</option>
** <input type="hidden" name=".cgifields" value="@apps" />
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]