PHP Includes, Page 2

1. This tutorial will show how to use PHP includes.
2. Do not redistribute, steal, or claim this tutorial as your own.
3. If you have any questions, use the ask and answer script.

Sidebar.php

Make a page called sidebar.php in the main directory of your site. Put all of your links and stuff that you would have on the sidebar. Save it in sidebar.php.
Your include would be:

Alphabet Links


Go to this page.. Notice at the top of the page, I have a few letters of the names I have already done. If I wanted to add another letter, I would have to go through all of the pages I already have, to add the new letter. To avoid that, I use PHP inludes.
I made a file called top.php, and put all of the letters that I've completed in it

My mommy name's page looks like this:


You may have noticed that I didn't use a path for that include, why not? Because top.php is in the same folder with all the letters. If it's in the same folder, you don't need to use your entire path.

Textarea Codes

Go to this page. See how the layout code is in the textarea? Let's say that there was a problem with the code. To fix it, I would have to fix the coding on one page, then fix it where I have to code at. I don't do that, because I use includes.

Simply put the layout code inside a file, then just edit the include and put it in the textarea! Easy, huh?

Need help with converting your layout into the header.php and footer.php files? Proceed to Page 3