Gossamer Forum
Home : Products : DBMan : Customization :

Run cgi script within html.pl

(Page 2 of 2)
> >
Quote Reply
Re: [donm] Run cgi script within html.pl In reply to
If that is causing problems for whatever reason you could do something like this (it is probably easier):

Create a new text file with your quotes inside like:

Code:
[
'This is quote one!',
'This is quote two!',
'This is quote three!'
'This is quote four!',
'This is quote five!'
];

Then in your code use:

Code:
my $quotes = do "/path/to/new_file.txt" or die $!;
my $random = $quotes->[rand @$quotes];

Then you have your random quote in $random
Quote Reply
Re: [Paul] Run cgi script within html.pl In reply to
Don:

Are you the only one adding quotes to the script as admin? If so, it might be much easier to just put all your quotes within your .cfg file or format.pl file and use the mod called.

Random E-Mail Advertisements

I use this to send random ads via email, but I'm sure the sub could easily be called anywhere within the script. The mod is listed in the resource center or in the FAQ under the section for Email.

Just an idea :)

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Run cgi script within html.pl In reply to
What makes you say it is easier?

My example above is two lines long as opposed to about 20 or so for the mod you suggested.

Keeping the quotes in a seperate text file makes it more scalable (and clearer) too Wink.

Last edited by:

Paul: Sep 26, 2002, 11:11 AM
Quote Reply
Re: [Paul] Run cgi script within html.pl In reply to
i followed the steps shown on here using
|; do("/home/egidio32/public_html/banner.pl"); print qq|

and it works, but for some reason
when it is displayed on the site, it prints out "Content-type: text/html " in front of the script. (which the script is a random banner script)

any ideas
Quote Reply
Re: [TKEP1008] Run cgi script within html.pl In reply to
Check you banner.pl file and comment out the line that prints out that line:

Content-type: text/html

Unoffical DBMan FAQ

http://creativecomputingweb.com/dbman/index.shtml/
Quote Reply
Re: [LoisC] Run cgi script within html.pl In reply to
what about if you wanted to run another db.cgi within the html.pl

for instance, i need to run

/services_link.cgi?db=services&&uid=default&view_records=1&ID=*&service_link=yes

within services.pl (my html.pl file)

any ideas?
> >