You are here: Re: Getting an included PHP script to to include a file in the same directory. « PHP Programming Language « IT news, forums, messages
Re: Getting an included PHP script to to include a file in the same directory.

Posted by Jerry Stuckle on 01/09/07 19:23

Daz wrote:
> Hi everyone.
>
> I am a little stumped at why when I try to include a file in same
> directory as the script being processed, it looks in the same directory
> as the script that included it to begin with. Is there any way I can
> get around this? Is there anyway to get the name and/or of the script
> being processed, rather than the name and/or path of the script that
> was first called?
>
> Many thanks.
>
> Daz.
>

Or, just always use the absolute path:

include $_SERVER['DOCUMENT_ROOT'] . '/path/filename.ext';

$_SERVER['DOCUMENT_ROOT'] will always reference the root directory of
your web server.

--
==================
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

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