01 02 03 04 05 06 07
★ Owner: Kayla
★ Opened: 06/09/17
★ Program: Photoshop CC 2020
★ Version: 13
★ Started Sw: 2005ish
★ Host: Myself
★ Credits: x
home content tutorials holiday contact ov

PHP Includes Tutorial - splitting into files

I use PHP Includes for the layout on my website. The whole point of PHP includes is so that instead of having to change something on every single page of your website, you only change stuff on the include pages.

For example- It would take FOREVER to add a new affiliate to every page of your website without the PHP includes. If you use the includes than you go to ONE page and it adds that affiliate to every single page. It saves soooo much time.

This teaches you how to separate your layout into header.php, footer.php, index.php, and style.css pages

SIDE NOTE: ALL of my stylesheets are already split into these files, so if you're using one than skip to my next php includes tutorial right there --> (CLICK HERE)

The Steps

1. Create a file called header.php
Find the part of your coding that looks like < div id="content" >.
Copy all coding above that part including the words < div id="content" >. Paste it into the header.php file.

2. Create a file called footer.php.
This time copy everything after < div id="content" > and paste it into the footer file.

4. Create a file called style.css
Put all of your layouts styled coding in there.
A) #container{ }
B) < h1 >
C) body{ }
D) blockquote { }
E) a.affie, a.affie:active, a.affie:visited { }
F) CLICK HERE for an example of my preppy layout tutorials style.css page! (it is very basic so it doesn't have a ton of stuff!)

5. Make an index.php file.
This is the MAIN page of your website, aka the home page.

6. Now on every page you create, make sure it ends in .php
Examples: brushes.php


CLICK HERE for PART TWO of this tutorial