On Mon, 19 Jun 2000, George Vieira wrote:

> Hi all,
> 
> OK.. I found what's going on but again I have no idea why it's doing this..
> 
> My "signup.cgi" is calling "counter.cgi" OK but is failing to pass the
> "domain" and "page" parameters over on the command line:
> $outcount=`/home/httpd/cgi-bin/counter.cgi domain=www.hexidecimal.com.au
> page=signup visible=true`;
> 
> inside of the counter.cgi script...
> domain=""
> page=""
> 
> Why does this fail? Is there another syntax to send to a CGI within a CGI???
> Works fine on the shell prompt but not within another CGI?
> 
> Any help by your Perl experts would be appreciated...
> 
Set the environment variable QUERY_STRING to the appropriate uri encoded
string (ie. as if it were a url).

use URI::Escape;
my %args = (domain=>'www.hexidecimal.com.au',
            page=>'signup' visible=>'true');
$ENV{REQUEST_METHOD} = 'GET';
$ENV{QUERY_STRING} = 
    join('&', map { "$_=".uri_escape($args{$_}) } keys %args);

It's possible the CGI you are calling depends on other things in the CGI
environment too.

This is one case where I'd probably use SSI.  Or make the counter a
module.  Or use HTML::Mason.

--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text

Reply via email to