home content tutorials holidays contact ov
This website is here to provide you with the necessities to design & code your own websites, signs, and much more. If you have any questions, message me on facebook! Please do not redistribute or copy anything on this site. Please credit my website when using anything! Thank you for visiting my website! I really hope you enjoy everything I have to offer! ♥
✿ Owner: Kayla
✿ Opened: 06/09/17
✿ Program: Photoshop 2023
✿ Version: 18
✿ Started Sw: 2005ish
✿ Host: Myself
✿ Credits: x

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

IN THE PUBLIC_HTML:
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.
Examples:
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
patterns.php
avatars.php
borderpsds.php

♥------------------------------------------------------♥

CLICK HERE for PART TWO of this tutorial

♥------------------------------------------------------♥