How to include php headers and footers on html site

Alright, so I built my site completely using html and css. I am finding that as I’m updating it along the way it is becoming rather laboursome to have to go to every single .html page to modify the header and footer code just so it will function the same. I know you can simplify this using php so you only have to modify the one file and it will automatically update for every page. So I guess my question is how do I go about doing that?

Alright, MAMP is working properly, but I’m having a problem. I changed my index.html to index.php and placed it in the mamp/htdocs folder. I tested to see if it worked by placing random text into the index.php file and it appeared in the browser so Woot! But when I paste my html code that I had before the page remains completely blank. Not even any < p >text< /p > is showing up. I’m not sure what I should do from here

I don’t believe I put anything for the root password. I tried adding the php code to the beginning and end of my html and when I refreshed my web page I got a server error instead of a blank white page

Tips

What now? I have some ideas for you.

Go explore CodePen!

As a front end designer and developer, you should have an account on CodePen so you can save your snippets, present your ideas, and engage with the rest other front end folk. I'd encourage you to go PRO as well, to unlock the full power of CodePen.

Get the newsletter!

You should sign up for the CSS-Tricks newsletter. It's a clean copy of all the blog posts each week, combined together, right to your inbox. If email isn't your thing, there is an RSS feed, iTunes, and lots of other ways to subscribe.

Listen to ShopTalk!

Subscribe to The Lodge!

The Lodge is a members-only, ad-free video learning area here on CSS-Tricks. Just like the free screencasts, but organized into four large complete series. Membership is also the #1 best way to support CSS-Tricks.

We can do the real footer now.

Site Links

Colophon

CSS-Tricks* is created, written by, and maintained by Chris Coyier. It is built on WordPress, hosted by MediaTemple, and the assets are served by MaxCDN. The fonts are Source Sans and Source Code Pro. It is made possible by viewers like you who subscribe to The Lodge and through advertising for products and services I like.