You are here: Re: The principle of include files in PHP, not as in C++ « PHP Programming Language « IT news, forums, messages
Re: The principle of include files in PHP, not as in C++

Posted by Jerry Stuckle on 10/16/07 01:53

duzhidian@gmail.com wrote:
> Thanks for your guys info. All your suggestions is to use absolute
> path somewhere.
>
> In fact, here is my scenario, *SAME* file name, different location:
>
> a. one php is locate at . called ./mylib.php
> b. another php file is located at ./lib/mylib.php
> c. third php file is located at ./lib/sublib/mylib.php
>
>
> a calls a function in b while b calls a function in c.
>
> What I need is just a clear picture how to include files in a and b,
> i.e. in ./mylib.php and in ./lib/mylib.php without any trouble when
> moving and future extension.
>
>
> I can organize the codes, but it does not seems as transparent as what
> c/c++ does as one file at root have to consider it's grandsons'
> functions (location), not supposed to do that in c/c++.
>
> Thanks again.
>
> Du.
>
>

You're still using relative paths. Anything starting with ".", ".." or
a path name is relative.

Absolute paths start with / in linux/unix.

It works exactly the same in C/C++. Relative paths there are relative
to the executable.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

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

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