You are here: Re: Includes with muli-level directories « PHP Programming Language « IT news, forums, messages
Re: Includes with muli-level directories

Posted by AlexVN on 12/18/45 11:50

FP wrote:
> I also have files;
> \D.php
> \F1\E.php
> \F1\F1_1\F.php
>
> File D has the lines "echo 'D'"
> File E has the lines "echo 'E'; include_once('../D.php');"
> File F has the line "echo 'F'; include_once('../E.php');"
>
> If I open file E in my browser I get "ED".
> If I open file F in my browser I get "FE" and an error saying file D
> doesn't exist.

Please check the PHP manual on include function:
"If filename begins with ./ or ../, it is looked only in include_path
relative to the current working directory."
Please use the http://www.php.net/getcwd in your D,E,F scripts to check
what is current directory. I suspect that when the E.php is evaulated
in context of E.php, the working directory is still \F1\F1_1 so the
include_once('../D.php'); is trying to include \F1\F1_1\..\D.php, which
is does not exist.

Sincerely,
Alexander
http://www.alexatnet.com

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация