Reply to absolute paths

Your name:

Reply:


Posted by Jon Slaughter on 04/21/07 22:36

do I have to prefix every absolute path with document root to get it to
work?

For some reason I thought that prefixing a path with '/' or './' with make
it absolute w.r.t to document root but I guess not?

e.g., when I do

include './Scripts/AddNav.php';

or

include '/Scripts/AddNav.php';

It only happens to work if that path is in the current directory but it
won't goto the root directory.

i.e., the above is doing the exact same as if I did

include 'Scripts/AddNav.php';

But in any case this doesn't work in general unless I use

include $_SERVER['DOCUMENT_ROOT'].'/Scripts/AddNav.php';

ofcourse this seems like a mess to do every time I want to use an absolute
path... which is a lot.

Is that what I'm stuck with doing or is there a function, say, like abp that
will take a path and prefix the document root to it?

Thanks,
Jon

[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

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