[ic] can I include another cgi script within [ic]?

interch interchange-users@lists.akopia.com
Fri Jul 27 13:25:00 2001


Hmmm is the cgi script not in perl?  If you really need to actually do a
POST or GET request to a cgi from within a catalog page something like
this would probably work, assuming AllowGlobal was set for the catalog.  I
haven't tested this in IC but I use something similar for cgi POST'S from
the command line for testing various scripts.


[perl]
my($content, $response, $status_code);
$content="var=value&var2=value&etc..."


($response,$status_code) =&http_request('POST','http://www.domain.com/cgi-bin/script.cgi',
$content);

return($response,$status_code);
   
sub http_request {
my ($method, $url, $content) = @_;

use URI::Escape;
use LWP::UserAgent;
use HTTP::Request;
use HTTP::Response;
$content = URI::Escape::uri_escape($content);
my $ua = new LWP::UserAgent;
my $request = new HTTP::Request($method, $url, undef, undef);
$request->header('content-type' => "application/x-www-form-urlencoded");
$request->header('content-length' => length($content));
$request->content($content);


my $response = $ua->request($request);

if ($response->is_success) {
    return($response->content,$response->code);
} else {
    return($response->content,$response->code);
    return($response->error_as_HTML,$response->code);
}


}


[/perl]



On Fri, 27 Jul 2001, Tim Watts wrote:

> on 7/24/01 3:09 PM, Thomas Swinney at thomas@biz-e-solutions.com wrote:
> 
> > I think the program found here will do what you need
> > http://smartcgis.com/executer/  tell me if that works.  Would like to know.
> > Looks like it would.  And it is very simple to use it appears.
> > 
> > Thomas (reply to thomas@biz-e-solutions.com if you don't mind)
> > 
> > -----Original Message-----
> > I've serched the archives but with no simple answer, has anyone found a
> > simple solution to include cgi output from other scripts into a [ic] page?
> > Tim
> 
> 
> Tim
> Romans1013.net
> Internet Hosting
> 
> _______________________________________________
> Interchange-users mailing list
> Interchange-users@lists.akopia.com
> http://lists.akopia.com/mailman/listinfo/interchange-users
>