Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
Pages: [1]
Send this topic | Print
Topic: include file from parent folder problem. :(  (Read 2077 times)
« on: January 25, 2006, 06:45:07 PM »
Vad Offline
Newbie

View Profile
*
Posts: 1



If i include a file from "inside" folder - all OK.
But when I try to do it with the upper level folder I have an error:

Warning: main(): open_basedir restriction in effect. File(../_wm.php) is not within the allowed path(s): (/home/freehost/scripts/:.) in /home/freehost/t35.com/d/a/dancephoto/test/folder1/index1.php on line 8
Warning: main(../_wm.php): failed to open stream: Operation not permitted in /home/freehost/t35.com/d/a/dancephoto/test/folder1/index1.php on line 8
Warning: main(): Failed opening '../_wm.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/freehost/t35.com/d/a/dancephoto/test/folder1/index1.php on line 8


I have a folders tree like this:
\test
  \folder1
     \subfold   
        _wm.php
     index1.php
  \folder2
    _wm.php

In folder1 I have the php file (index1.php) with the code

...
<?php include "../_wm.php"; ?>
<hr>
<?php include "../folder2/_wm.php"; ?>
<hr>
<?php include "subfold/_wm.php"; ?>
</pre>
...

Only the last include() is working correctly.
But I want to include a file from the upper level folder. How can I do this?
Page is here   http://dancephoto.t35.com/test/folder1/index1.php

Thanks in advance.
Report to moderator   Logged

 
« Reply #1 on: February 04, 2006, 08:01:42 PM »
Alex Melen Offline
President / Founder
Administrator
Addict

View Profile WWW
*****
Posts: 2,000



The file you are getting/executing has to be in the same folder as the file that is calling it.
Report to moderator   Logged

 
Pages: [1]
Send this topic | Print
Jump to:  

Powered by SMF | SMF © 2006-2008, Simple Machines LLC