can not require or include a file
Posted: Wed Apr 14, 2004 12:19 pm
My dir structure is:
rootdir
|___dir1
| |__file1.php
| |__file2.php
| |__file3.php
|
|___dir2
|__file4.php
So I wrote some code
In file3.php
<?
require("file1.php");
require("file2.php");
?>
When I placed file4.php in the rootdir and write it as following
<?
require("dir1/file3.php");
?>
The script run completely
But when I move file4.php into dir2 and write some code in it as following
<?
require("../dir1/file3.php");
?>
I recieved a warning:
Can not open "../dir1/file1.php" for require..... in file file3.php at line...
Please help me to solve this problem.
Thanks very much!
rootdir
|___dir1
| |__file1.php
| |__file2.php
| |__file3.php
|
|___dir2
|__file4.php
So I wrote some code
In file3.php
<?
require("file1.php");
require("file2.php");
?>
When I placed file4.php in the rootdir and write it as following
<?
require("dir1/file3.php");
?>
The script run completely
But when I move file4.php into dir2 and write some code in it as following
<?
require("../dir1/file3.php");
?>
I recieved a warning:
Can not open "../dir1/file1.php" for require..... in file file3.php at line...
Please help me to solve this problem.
Thanks very much!