[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Forced banner ads?



Barnabas Toth <barnabas@xxxxxxxxxxxxxxxxxxxxx> wrote:
> I hope someone can help me out on this one. Anyone know of a banner script
> that will automatically load a banner at anyone who is requesting any
> page(s) from my server? Something that is done on the server side. So I
> don't have to include any code in the HTML pages? Something like how
> Geocities and FortuneCity do it? Or do I have it all wrong and this can't
be
> done?

I've never used these (just thought about it) but there is a perl module
called Apache::Footer that will add footers to a webpage.  Check out
http://www.modperl.com/ and the following URL in particular:
www.modperl.com/perl_conference/cool_tricks/mp_footer.html.  There is also a
module called apache::sandwich (see
http://www.cpan.org/modules/by-module/Apache/Apache-Sandwich-2.04.readme)
that does one better by doing headers in addition to footers.  Again, I've
never used either.  Within PHP, there are the auto_prepend_file and
auto_append_file options which can be used to accomplish nearly the same
thing, but they aren't as powerful.  They can be configured in the php.ini
file or in .htaccess for more control within the server.  Unless you want
every php file on your server to have files prepended and/or appended to
them, you'll *definitely* want to go the .htaccess route.

You could also write your own scripts to parse files on your server and
embed whatever code you want if it's not found in the file already and drop
that in cron to automate it.  You'd probably have to stagger multiple copies
of the script that are each responsible for a chunk of files or use a
database system to track what files have been parsed and when.  Going this
route could be a nightmare, but it is an alternative.

Steven Werby {steven-lists@xxxxxxxxxxxx}