Dumb CGI question...

bro

Perch
Don't know how, but I've managed to get away with never having to get a cgi script working for about the last 8 years. Now I do.

I enabled CGI in hpshere and set .cgi as one of the file extensions.

I uploaded a small file hello.cgi into my root directory.

It's just
#!/usr/local/bin/perl
print "Content-type: text/html\n\n";
print "<H1>Hello World</H1>\n";

If I go to mydomaincom/hello.cgi it shows me 'Hello World' in H1. No problem.

If I include it in another file like this:
<!--#include file="hello.cgi"-->

it shows me the Perl script as above, and doesn't try to parse the script at all.

So it includes the file, but doesn't try to interpret it, just displays it all as text, including the '#!/usr/local/bin/perl' part etc.

What am I doing wrong? Can Perl scripts be included like this on JH servers? I have files from another host to try to get working, so I know this format is possible elsewhere.
('SSI Exec Enable' is enabled in hsphere.)
 
Thanks, Prakash. That will allow me to convert the site pretty easily. (Fast and helpful support from Jodo as usual.)

For anyone else's info, it seems SSI commands are not necessarily standard across all servers. The previous server for this site allowed CGI scripts to work from an #include command, whereas Prakash converted that to an #exec command to allow inclusion of the cgi script.

Now that it works, I have time to dump all the Perl and convert it to something I understand :)
 
Back
Top