D
Devyn
Hi All!
I'm a newbie to perl. I've written a small cgi script that runs as
the consequence of a form with radio buttons.
After the button is clicked, an exe is to run. How much ever i try, i
cant get that to happen. I hear a "ding" sound which is indicative os
some error.. I can run the perl script in command line using perl
getdata.cgi. I have win98, IE6. Here's the code :-
#!c:\perl\bin\perl.exe
if ($ENV{'REQUEST_METHOD'} eq 'POST')
{
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$form{$name}=$value;
}
}
system "front.exe";
if($form{'R1'} eq 'V1')
{
open(a,"Parta.txt");
$stockA=<a>;
close(a);
print"Content-type:text/html\n\n";
print"<html><title></title><body>";
print"<body text=\"\#FFFFFF\" bgcolor=\"#000000\">";
print"\n <p align=\"center\"> <font size=\"5\"
color=\"\#FFFFFF\">The number of part A components in the warehouse is
: </font><font size=\"5\" color=\"\#FF6600\">$stockA</font></p>";
}
......and so on....
Where have i gone wrong? Any help will be appreciated..
Regards,
Devyn
I'm a newbie to perl. I've written a small cgi script that runs as
the consequence of a form with radio buttons.
After the button is clicked, an exe is to run. How much ever i try, i
cant get that to happen. I hear a "ding" sound which is indicative os
some error.. I can run the perl script in command line using perl
getdata.cgi. I have win98, IE6. Here's the code :-
#!c:\perl\bin\perl.exe
if ($ENV{'REQUEST_METHOD'} eq 'POST')
{
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$form{$name}=$value;
}
}
system "front.exe";
if($form{'R1'} eq 'V1')
{
open(a,"Parta.txt");
$stockA=<a>;
close(a);
print"Content-type:text/html\n\n";
print"<html><title></title><body>";
print"<body text=\"\#FFFFFF\" bgcolor=\"#000000\">";
print"\n <p align=\"center\"> <font size=\"5\"
color=\"\#FFFFFF\">The number of part A components in the warehouse is
: </font><font size=\"5\" color=\"\#FF6600\">$stockA</font></p>";
}
......and so on....
Where have i gone wrong? Any help will be appreciated..
Regards,
Devyn