Hi,

Bit of a puzzler here. What would be the correct way of running a CGI and
have its output embedded on an Apache::ASP page?

The site I'm working on has no frames & uses headers and footers to provide
formatting. What I want to be able to do is to print my headers, the output
from the generic CGI, then print my footer. Obviously, a redirect wont work
here & an include will not execute the cgi. I need an 'exec and include
output' command.

I've come up with a horrible .asp wrapper hack for now that works for me,
but I'm convinced there must be a 'proper' way of doing this.

#!/usr/local/bin/perl asp
<%
$Response->Include($Server->MapPath("/gui/header.inc"));
my $me = basename($0);
$me =~ s/\.asp//;
my $content = `env "$ENV{'QUERY_STRING'}" ./$me.cgi`;
$content =~ s/Content-type:.*\n//;
$content =~ s/<html>//;
$content =~ s/<\/html>//;
$content =~ s/<body[^>]*>//;
$content =~ s/<\/body>//;
print $content;
$Response->Include($Server->MapPath("/gui/footer.inc"));
 %>

--
Ian Cass




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to