Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

SSI in a CGi script! Can someone help!

Quote Reply
SSI in a CGi script! Can someone help!
Hello.

I have this program

Code:
#!/usr/bin/perl
$num_links = 4;
print "Content-type: text/plain\n\n";
my $LASTX = $num_links;
open (DB, "<admin/data/links.db");
my @lines = <DB>;
close DB;
#setup list
print qq|
<table><UL class="mainlinks">
|;
for ($i=$#lines; $i>=$#lines - $LASTX; $i--) {
chomp $lines[$i];
@fields = split(/\|/,$lines[$i]);
#----UNFORMATTED----
#foreach $field (@fields) {print "$field\n"};
#----FORMATTED----
print '<LI><a class="side" href=http://mysite.com/';
print "@fields[3]/";
print "@fields[0]";
print ".shtml>";
print @fields[1].'</A>';
print '</LI>';
print "\n";
}
#end list
print qq|
</UL></table>
|;
now because cgi cant run in cgi i wanted to make it a global

<%hdln%>

what would be the correct procedure as to get the desired results?!

Thanks Again

Gian Wilson


Quote Reply
Re: SSI in a CGi script! Can someone help! In reply to
This looks like it's for Links 2.0 not Links SQL.

You _can't_ call SSI in a CGI script, since SSI stands for SERVER side includes, and the server never sees the output generated by the cgi script (same with cgi-generated PHP... the server never knows it's a .php page).

You can add that routine _into_ the .cgi script, and call it as a subroutine inside the calling script.

In Links SQL 2.0 if it was just a template tag, then you could actually do that in the globals.txt file, and have it compiled as a function-tag.

PUGDOGŪ
PUGDOGŪ Enterprises, Inc.
FAQ: http://pugdog.com/FAQ