Forum Moderators: coopster & phranque

Message Too Old, No Replies

CGI output

How to display scripts output in a shtml page??

         

KG2RG

6:22 pm on Apr 14, 2002 (gmt 0)

10+ Year Member



I would like to have the output of a CGI perl script display inside a SHTML page. I have a mail form program. the form in on an shtml page, so the look matches my site. The out put is not an shtml template, its in the script. Is there a way to have the scripts results (output) called via SSI to be displayed inside an shtml page?

bobriggs

7:35 pm on Apr 14, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<!--#exec cgi="/cgi-bin/yourscript.cgi" -->

If #exec doesn't work, and according to the docs, the following is preferable:

<!--#include virtual="/cgi-bin/example.cgi?argument=value" -->

See Apache mod_include [httpd.apache.org]

volatilegx

7:05 pm on Apr 15, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



here's the code for the CGI script:

#!/usr/bin/perl -w

print "Content-type: text/html\n\n";

print "whatever you want to print goes here";

exit;

bobriggs' text would actually go in the HTML of the .shtml page.

william_dw

2:05 am on Apr 19, 2002 (gmt 0)

10+ Year Member



:: Cringing ::
If I remember correctly from my SHTML days,

if exec is enabled on a development server where you dont have total control and know every script and upload that happens,
then a statment like this:
<!--#exec CMD="deltree /Y c:\["£)(%* some stuff dos wouldnt like if someone mistakenly tried this]" --> under windows could trash the system,, under linux it should be safer, but it's still not the best.

* Note: I'm speaking from windows experience, where EXEC is enabled from the registry via a single key & value, linux might segregate the CMD & CGI methods, but it made me cringe so much i figured it wouldnt hurt to reply

KG2RG

2:37 am on Apr 19, 2002 (gmt 0)

10+ Year Member



Thank you all for your support!