Folders in PHP

If you use PHP and you have folders, chances are you upload your layout to all of your folders so that the layout will show. Alas, there is an easier way to include your layout in all of the pages in your folders.

On all of your pages, you have something like this:

<? include("top.php") ?>
<? include("bottom.php") ?>

Well, for the pages in your folders/directories, you have to add ../ to that PHP code. For example, if you have a page (brushes.php) that is in a folder (graphics), your PHP code in brushes.php would look like this:

<? include("../top.php") ?>
<? include("../bottom.php") ?>

See how the following is added: ../? If you had a page (brushes.php) that was in a folder (graphics) that was in another folder (goodies), it would look like this:

<? include("../../top.php") ?>
<? include("../../bottom.php") ?>

Each ../ stands for a folder. In the case above, there were two folders (graphics and goodies), so two ../ were added

That should make adding folders to your site less of a hassle.