Gossamer Forum
Home : General : Perl Programming :

Including a script in a script

Quote Reply
Including a script in a script
Hello,

Can anyone help me find out how to include a script into another script. I am using dbMan on a website and the website is making use of a banner rotator in 4 different locations on the pages. Since dbMan uses CGI, and not HTML, to generate the pages, I can't use the normal Include Virtual commands. I've used the following:

<script language="javascript" src="/cgi-bin/banners/banner.cgi?cat=t01"></script>

but this did not work (looking at my error log file, I found a couple Premature End of Script Header error msgs). I've also looked through the forum to see if others have asked this but the things I found seem to relate more to rewriting the included file as code inserted as a module in the script and then calling that routine. However, the banner rotator I am using is an extensive process using several differnt scripts itself.

Accepting ideas from anyone.


MG International
Web Designs & Development
Quote Reply
Re: [ambitious] Including a script in a script In reply to
Off the cuff... I'd use frames. But I'm sure that is not the solution you're looking for, I just thought I'd mention it in case you're lazy like me. Cool
Quote Reply
Re: [ambitious] Including a script in a script In reply to
Something like this at the beginning of the script you want to include the other one in;

require "file.cgi";

Then, where you want to display it by doing somethig like;

&function;

You would obviously rename the function to invoke the script on the appropriate function. Could get messy...specially if there are similar types of subs...but I'm not sure of any other way to do it, other than IFRAMES.

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy.] Including a script in a script In reply to
Check out this thread:

http://www.gossamer-threads.com/perl/gforum/gforum.cgi?post=94268

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/