This isnt that complicated. If your trying to include() a file you need to know the basic heirachy of your website.
so lets say this is your current setup
/html/dekaron/website/deadfront/
All the words within the slashes are their own separate folders. So opening your file uploader you should just see /html/ then clicking on it will open /dekaron/ folder. Etc etc.
So lets say you have a index.php file in the /website/ folder. Which is the root of your website. so going to
will open the 'index.php' file of /html/dekaron/website/. Make sense so far?
Now. For your include() function. It looks like your including the deadfront.php from the /dekaron/ folder. Correct? So the complete file path in my example is /html/dekaron/deadfront.php ........... BUT! Your websites full path is located at /html/dekaron/website/. So this is where you need to learn hyperlinking to separate folders. As you can see from that example 'deadfront.php' is located one folder tier up from 'index.php'. This is how you include it.
'./' = same folder directory
'../' = back one folder directory (parent directory)
So. Here goes. You need to go up one tier for your deadfront.php folder. This is the code to do a include as understood from your index.php.
Code:
<?php
include("../deadfront.php");
?>
As you can see the ../ means go up a parent level. If your deadfront.php was located in the /deadfront/ folder of the example and index.php was in the same place your php would look like this:
Code:
<?php
include("./deadfront/deadfront.php");
?>
As lastly if your deadfront.php was in the same location in the folders as 'index.php' then your code would simply read:
Code:
<?php
include("./deadfront.php");
?>
or
Code:
<?php
include("deadfront.php");
?>
You can use this for multiple folder layers also such as deadfront.php being inside just the /html/ folder. Then you would use this:
Code:
<?php
include("../../deadfront.php");
?>
As you can see it uses 2 '../' which means go up 2 parent levels. Hopefully that massive explanation helps you out. I know it did for me when I first started. Heres a briefer overview:
Relative linking always omits the
part of the URL
When referencing a location on the same Web site, it is best to use Relative Linking. The file is found based on the location current of the current file
To link to another file in the same folder as the current document, simply enter the filename.
To link to a file in a subfolder of the current document’s folder, provide the name of the subfolder, then a forward slash /, and then the filename.
Example: graphicsfolder/my.gif
To link to a file in the parent folder of the current document’s folder, precede the filename with ../
(where “..” means “up one level in the folder hierarchy”).
Example: ../index.htm
OH! I forgot to add. All included files must be inside your 'public_html' folder! You cannot include files from a resource file located in the parent directory! (I know thats atleast true for client files such as java and CSS; and yes I know that PHP is server-sided sooo.... Someone test lol.)
If you had no idea what I just typed then dont worry about it and figure it out.