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 Michael Fesser on 10/15/07 23:25

..oO(duzhidian@gmail.com)

>If I move the programs to other places, using absolute paths will
>suffer, need to change every file.

As long as you keep the folder structure the same, you won't have any
problem. You can always use $_SERVER['DOCUMENT_ROOT'] as your starting
point to build your absolute paths. It becomes even more convenient if
you define some path constants in one of your main PHP files that's
included in every page, and use these constants when you include the
other files. If you change the server, but keep the folder structure,
you would only have to adjust a single file at most, if any.

Absolute paths work always, and you don't have think much about them.
Define them once in a single place - and then just use them.

Micha

 

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

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