I have read many posts about this but have so far been unable to get my script to call another of my scripts passing variables along with it
NOTE: Both my scripts are in the same directory on the same server
(ScriptA.cgi)
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
#GET QUERY ATTRIBUTES
$source = $ENV{'QUERY_STRING'};
@pairs = split(/&/, $source);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("c", hex($1))/eg;
$SOURCE{$name} = $value;
print "name- $name = $value <BR>"; #DEBUG
}
local ($page) = "";
$SubPage = "ScriptB.cgi?LoginId=$FORM{'LoginId'}&Password=$FORM{'Password'}";
$OutPut = qx|perl $SubPage|;
$page = $page . $OutPut;
print $page;
(ScriptB.cgi)
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
$test = $ENV{'QUERY_STRING'};
@pairs = split(/&/, $test);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("c", hex($1))/eg;
$FORM{$name} = $value;
print "name- $name = $value <BR>"; #debug
}
NOTE: I need these to be in separate scripts
Any help would be greatly appreciated
Cheers
Jeff
NOTE: Both my scripts are in the same directory on the same server
(ScriptA.cgi)
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
#GET QUERY ATTRIBUTES
$source = $ENV{'QUERY_STRING'};
@pairs = split(/&/, $source);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("c", hex($1))/eg;
$SOURCE{$name} = $value;
print "name- $name = $value <BR>"; #DEBUG
}
local ($page) = "";
$SubPage = "ScriptB.cgi?LoginId=$FORM{'LoginId'}&Password=$FORM{'Password'}";
$OutPut = qx|perl $SubPage|;
$page = $page . $OutPut;
print $page;
(ScriptB.cgi)
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
$test = $ENV{'QUERY_STRING'};
@pairs = split(/&/, $test);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%(..)/pack("c", hex($1))/eg;
$FORM{$name} = $value;
print "name- $name = $value <BR>"; #debug
}
NOTE: I need these to be in separate scripts
Any help would be greatly appreciated
Cheers
Jeff