Gossamer Forum
Home : Products : DBMan : Customization :

SSI from within cgi?

Quote Reply
SSI from within cgi?
Howdy Folks!...got a question?...how can one call a SSI from within dbman script...I have checked how Webadverts does it but that technique seems to work only with the Webadvert script...anyone got any ideas?...thanks.. still a Novice...Rob
Quote Reply
Re: SSI from within cgi? In reply to
Basically you don't, you have to simulate it with a subroutine that does the same thing. For example, to simulate a file include, you would need a subroutine like this:

sub include_file {
open(FILE, "/path/to/file.ext") or die("Couldn't open the file.");
@lines = <FILE>;
close(FILE);
foreach $line (@lines) {
print $line;
}
}

And where you would normally put the SSI call in the HTML output, you would now put:

&include_file;

...making sure you close off any print statements first.

Cheers,
adam