coleary Posted March 23, 2004 Posted March 23, 2004 Is there anyway to add an overall header or footer to every single page in my site without editing every single page that currently exists? Quote
MikeJ Posted March 23, 2004 Posted March 23, 2004 Rename the pages to use a .php extension and use a PHP include: <?php include("includes/footer.html"); ?> Or rename the pages to use .shtml extention and use Server Side Includes: <!--#include virtual="/includes/footer.html" --> You could also add an apache handler to tell the server to handle standard .html as PHP or SSI, so you don't have to rename extensions. Quote
DarqFlare Posted March 23, 2004 Posted March 23, 2004 Yeap. if you include the PHP/SSI file, then the one being included will simply have straight HTML in it. Quote
TCH-Don Posted March 23, 2004 Posted March 23, 2004 No, you will have to edit all the pages one time to add the includes. But a good text editor or search and replace tool can help. But once you have made the changes it will be well worth it. For those that are wondering why coleary wants to do this, try the mini php tutorials from Total Choice hosting. php mini tutorial by Jim Uni and php mini part one tutorial by TCH-Jack to see how well the includes work. A quick change in the header can make the whole site look different. Quote
coleary Posted March 24, 2004 Author Posted March 24, 2004 Figured as much, was sort of afraid of that. The main reason I want to do this is for site-wide announcements (I have 3 different sub-domains that different groups of people use). Thanks for the quick replies. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.