Web Hosting Talk







View Full Version : include a footer on all pages?


leet_mike
09-19-2004, 02:31 PM
Ok here goes...

i run a free hosting company (free-hoster.com) i would like to include a footer or a header on all the pages and directorys for when people signup theres a small advertisment. im sure this can be done with .htaccess becouse i had a line of code for it before.

Does anyone happen to have this script in their bag of tricks? lol

Thank You...
There is a lot of great reading in here!

sea otter
09-19-2004, 02:49 PM
was it mod_layout?

http://tangent.org/?view=mod_layout

There are also cpan perl modules to do this. I posted a url in another thread, but I can't find it now :(

leet_mike
09-19-2004, 03:14 PM
i tried mod_layout but thats all too confusing for me

sea otter
09-19-2004, 03:26 PM
Originally posted by leet_mike
i tried mod_layout but thats all too confusing for me

Oh. Well, hopefully someone else can remember what you did. Good luck :)

Loon
09-19-2004, 05:28 PM
Other than mod_layout, you can use the following in a .htaccess file (or find and set the values directly in php.ini to have it work server wide)


php_value auto_prepend_file "/path/to/your_header.php"
php_value auto_append_file "/path/to/your_footer.php"


This would obviously only include the header + footer into php pages though, to include them into others such as HTML you'd need to configure those extensions to parse PHP

AddType application/x-httpd-php html

Obviously you might want to consider other extensions .htm, .shtml, .cgi etc etc

Gator99
09-21-2004, 01:38 AM
I've used a "canned footer" apache module like illustrated here:
http://www.oreilly.com/catalog/wrapmod/chapter/ch04.html
It worked rather nicely.