Gossamer Forum
Home : General : Perl Programming :

SSI vs DBMAN

Quote Reply
SSI vs DBMAN
Hi..
I have a db with dbman and i have a admin banner system. I need put this sentence in each .html
<!--#exec cgi='ads.pl' -->
but the html of the db are in file.pl
If I put this code into file.pl this code not function. what is the problem???
Quote Reply
Re: SSI vs DBMAN In reply to
SSI does not work from within a cgi program because the output is not parsed. If you are using webadverts, use the included subroutine as mentioned in the docs.

--mark
Quote Reply
Re: SSI vs DBMAN In reply to
Actually it works, if you do it this way:
Code:
$myads = "<!--#exec cgi='ads.pl' -->";
print "$myads";
or this:
Code:
print "<!--#exec cgi='ads.pl' -->";
At least I do it this way on my site Smile

Pasha

------------------
The Flying Cranes, Inc:
http://www.theflyingcranes.com
Perl scripts & Web promotion:
http://find.virtualave.net
Quote Reply
Re: SSI vs DBMAN In reply to
Mark is right - no surprise Smile Dynamic pages created on the fly are not parsed. You can insert SSI code in script generated pages for parsing if the page is static - created in advance and saved as a HTML file. Pasha is probably referring to the static pages (for example, Links category HTML pages). Dynamic pages (for example, Links search result pages) will not be parsed and SSI will be ignored.

Dan Smile
Quote Reply
Re: SSI vs DBMAN In reply to
As Mark mentioned you can create a sub-routine in the default.cgi file, such as:

Code:
sub include_file {
open(FILE, "/cgi-bin/ads.pl")
or die("Couldn't open the file.");
@lines = <FILE>;
close(FILE);
foreach $line (@lines) {
print $line;
}
}

You would call this sub-routine in html.pl with the following code:

Code:
&include_file;

There is also a Thread in the DBMAN Discussion Forum that discusses this issue:

http://www.gossamer-threads.com/...m12/HTML/000446.html

Regards,


------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us