Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Apache - HTML Header Code

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Any ideas on how to have every page sent by Apache to have prepended some HTML code?

I have a menu that I want put on every page on my server. Simple HTML code will cause the menu to be generated.

--TIA

 
In order of increasing complexity:

1. You can just use Server Side Includes (SSI), in every page where you want to load your common HTML elements. The drawback is that this requires at least that little bit of SSI code to be included on all your pages. The advantage is that you are not stuck with a header on *every* page, if you want some pages to be different.

2. If you install PHP with Apache (I recommend it highly), you have the option in your php.ini file for "auto_prepend_file" and "auto_append_file", which will do exactly what they sound like: give you the option have a file automatically loaded before and after every PHP page in your site.

3. Also, there is a module for Apache called mod_layout at that should do exactly what you want. (There is another Apache module called mod_header, but that has nothing to do with HTML; it is for people who want to mess with HTTP headers).
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top