PHP Includes
1. This tutorial will show how to use PHP includes.To be honest, I think PHP includes are the best thing since Doritos. I use them all over this site, and they truly make maintaining my site easier! Let's be real, no one has the time to sit and edit every single page do they? I mean even if you had the time, would you want to? So let's get to it, and find out about the awesome ways to use PHP includes. First, let's introduce ourselves to PHP first.
2. Do not redistribute, steal, or claim this tutorial as your own.
3. If you have any questions, use the ask and answer script.
Find Your Path
To use PHP includes, you have to know your path. Don't know it? In your site, make a page called "pathfinder.php" Copy the code in the text box below, and paste it into pathfinder.php. Make sure you take out the two underscores (_)
Got your path? Your PHP include will look like this:
So, if you have a header.php file in the main part of your site, your include would be like this:
What if you have a file inside another folder?
Does this help? I hope so.
So now, you know what your path is. You know how to use it. Let's talk about the different ways to use includes.
Proceed to Page 2
