I need help with this PHP script error

09/22/2010 07:53 dannyx12345#1
this is the error im getting can neone point me in the right direction??



Warning: include(deadfront.php) [function.include]: failed to open stream: No such file or directory in /dekaron/index.php on line 329

Warning: include(deadfront.php) [function.include]: failed to open stream: No such file or directory in /dekaron/index.php on line 329

Warning: include() [function.include]: Failed opening 'deadfront.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /dekaron/index.php on line 329
09/22/2010 10:13 pieter#2
how hard can it be?
the file /dekaron/index.php
does not exist or cannot be opened
09/22/2010 10:52 Decima#3
maybe he needs to unlink his file pointers lol

or, he is directing the path to deadfront.php to a file (in this case index.php) instead of a directory, like a noob :P
09/22/2010 13:50 ҉ THT ҉#4
Warning: include(deadfront.php) [function.include]: failed to open stream: No such file or directory in /dekaron/index.php on line 329
09/22/2010 16:41 dannyx12345#5
ok first of all im not retarded and second i removed that part of the directory for privacy reasons so noobs like u cant read where its from u can either tell me how to fix it or gtfo my thread -.-

@THT the file is there ive double checked making sure its in the correct area. and ive checked my spelling of the files and the index.php looks good also.
09/22/2010 17:16 ҉ THT ҉#6
make sure index.php is in a sub map called dekaron/
09/22/2010 19:39 dannyx12345#7
the Index.php is in that directory i just double checked
09/22/2010 19:57 HellSpider#8
Do you have deadfront.php in the same directory as index.php?
09/23/2010 00:00 Decima#9
No such file or directory in /dekaron/index.php

he has it setup to look at that whole thing as the directory, and index.php isnt ever going to be a directory, look at the include path, u either have the path set to the path+index.php, or you have it set to look at the current page's path, which will include the page as well

i dunno if anyone is understanding what i am saying, its hard to explain, hes either using $PHP_SELF in the include path, or he has the include function jacked up

how about pasting the line of code in which the include is part of, that would help everyone here better assess the problem
09/24/2010 03:55 dannyx12345#10
ok so i cant find the info if ur interested in helping me out pm me i need someone who knows about php scripting and cpanel pm me and well work it out on TV or something cus i dont know what ur asking for
10/02/2010 06:35 -8gX#11
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 [Only registered and activated users can see links. Click Here To Register...] 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 [Only registered and activated users can see links. Click Here To Register...]
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.