Web Hosting Talk







View Full Version : Adding Banner Code to All pages, How can I do this?


wmac
09-05-2002, 01:24 AM
Hello

I am going to sponsor some limmited club websites in exchange to banners on their pages (either top or bottom).

1- How can I force apache do this for me?

2- Is it possible to imlement it on an Ensim or CPanel hosting account or I will need a whole server for this?

Mac

Jedito
09-05-2002, 02:43 AM
If I'm not wrong, you can do it through mod_template (I'm not sure about the mod name), I was looking for the correct name, but that's the one that come from the top of my head.

Sorry if I can't help you more :(

davidb
09-05-2002, 02:45 AM
I had this done, more or less it is fairly simple. The best way, imho, is first you need a script(I prefer perl) This script will take the html of the page requested add in the banner code, then print it back out. Then of course you have it run every time a page is requested, this can be done with .htaccess to be honest. I did this about 1.5 years ago. I can tell you this, it will work. Whatr I recomend you try to do is get someone who has a solutionscripts.com login to home free. In there is a user contributed program(not piracy in my opinion), and that does the taking of the html and the banner adding. You then just need the apache part, which isent too hard. One downside is the fact that perl will have to run every time a page is run. Also if you get your hands on the program, it can be customized and it can be MUCH shorter, its already not too long, but I cut it down to about 1/3 before I just started from scratch.

wmac
09-05-2002, 02:55 AM
Jorge and David,

Thank you for your help.

But perl method will use a lot of server resources as it needs to parse evy single page.

I will look after mod_template and if I can not find a suitable solution then I will ask website owners to include the banner themselves.

Mac

Jedito
09-05-2002, 03:04 AM
I'm sure that there is an apache mod where you can add header or footer to all the pages served, but I'm not sure now if its mod_template :(

Jedito
09-05-2002, 03:18 AM
Finally found it :)
the name its mod_layout :D

wmac
09-05-2002, 03:32 AM
Danke! :)