Jump to content

Archived

This topic is now archived and is closed to further replies.

dptr1988

How do I automatically included a header?

Recommended Posts

How can I insert HTML codes into the begining or end of each document that apache serves that has the mime type of text/html? Kind of like the way free webhosting sites insert advertisements in your page.

Share this post


Link to post
Share on other sites
go into your httpd docs, or apache config, and use auto-prepend or auto-append, top and bottom respectivly. If you don't know these two, or how they work, google them. I kinda remember, but am not for sure. Google should return good results, however.

Share this post


Link to post
Share on other sites
Thank you. I googled "auto-prepend apache" and found my answer. It is done with PHP directives auto_prepend_file and auto_append_file. Thank you for your help, otherwise I wouldn't have know what to search for.

Share this post


Link to post
Share on other sites
The other option, what I use, is the .shtml extension. It is server-side html. So you can put a tag on shtml pages that will insert the code that is located in the file you specify in your tag.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.