Page 1 of 1
Including A File Within A Directory
Posted: Fri Jul 01, 2005 11:32 pm
by Majoraslayer
Alright, now I'm trying to use include on some files within a directory. For some reason, it isn't working. If you can tell me something, please let me know. To see what I'm talking about, go to
http://zorasdomain.com/phprogram/index.php
Code: Select all
<?php
include ("e;/html/editorjava.html"e;);
include ("e;/html/index.html"e;);
include ("e;/html/editpopper.html"e;);
?>
Posted: Fri Jul 01, 2005 11:43 pm
by smo
If you are trying to include a file which is one step up in the path and inside html directory then use like this
include "../html/index.html";
If it is at one step up then
include "../index.html";
But from the root if you are trying to go one step up then permission problem will be there.
HTH
Posted: Fri Jul 01, 2005 11:50 pm
by Majoraslayer
I tried adding the .. to the code, and no change. Also I CHMOD-ed the html directory to 777 (full permission), so I don't know what I'm missing. The book I'm reading on it said something about the include path, but within the syntax it assumes you're setting it on a local machine, with D:\somepath
Posted: Sat Jul 02, 2005 12:22 am
by smo
If you are in a server inv then you don't need to give path like D:/html ... that will not work.
From the present position ( path ) you have to calculate the file ( relative to the script location ) and include
Posted: Sat Jul 02, 2005 1:09 am
by Majoraslayer
I saw what the problem was; I just had to CHMOD the individual files instead of the directories they were contained in. Its working fine now, so thanks for the help anyway!