How to Convert a Site to PHP
This tutorial was created by me.
DO NOT copy, steal, or redistribute without permission.
This tutorial might seem a bit intimidatig, but is easier than one might think. And besides, it will make your life way easier!
- Before we begin, change all of your page's extensions from
.html to
.php.
- For PHP conversion, we
only focus on the coding in between the
body tag of the document.

- Typically, there are three parts to a PHP site: a header, a container, and a footer. Let's start with the header...
- Highlight all of the coding that deals with your site's header. Cut it, and paste it into a new document. Save that new document as
header.php.

- Next, highlight any coding dealing with your sidebar, or whatever content is constant on every page. Cut it, and paste it into a new document called
container.php.

- You'll then see your page's content. Do not edit that. Leave it right there. You'll see why in a second.

- Then, highlight the coding that deals with your footer (if you have one). Cut it, and paste it into a new document. Save it as
footer.php.

- On your page, above the content, you'll need to insert a couple of PHP includes for your header and your container. They should look exactly like this:

- Then, below the content, insert a PHP include for your footer.
- Now, insert these includes on every page of your website.
- Upload
header.php,
container.php,
footer.php, and your page to your FTP.
And that's it! Your site should look exactly the way it did before, except now if you need to edit anything site-wide, you just have to edit one of the three new documents we just made, and it will update all of the pages on your site!