Reply to Re: Getting an included PHP script to to include a file in the same directory.

Your name:

Reply:


Posted by boclair on 01/11/07 03:48

Daz wrote:
> Michael Fesser wrote:
>
>> .oO(Toby Inkster)
>>
>>> However, it's a good idea to have a specific "includes" directory, put all
>>> your included files into there and then just refer to them as:
>>>
>>> include 'myfile.php';
>>>
>>> without including a directory path at all(!) but instead using the
>>> include_path setting to specify where include files will be found.
>> I prefer absolute paths, so I usually define a constant which contains
>> the path to my include files, based on $_SERVER['DOCUMENT_ROOT'].
>>
>> Micha
>
> I prefer relative, mainly echo because my modules then become portable and self-contained

Just a suggestion. How about concating $_SERVER['HTTP_HOST'] and
$_SERVER['SCRIPT_NAME'] to provide the absolute URL on whatever the
server. Useful for header() re-directs.

Louise

[Back to original 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

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