Re: relative paths

From: Date: Sun, 18 Nov 2001 23:43:34 +0000
Subject: Re: relative paths
References: 1  Groups: php.general php.windows 
Request: Send a blank email to php-general+get-75046@lists.php.net to get a copy of this message
An easy way to fix this common problem is this: define('BASE_INCLUDE_PATH','/var/www/includes/'); include(BASE_INCLUDE_PATH.'my_include.inc'); Just make sure to include the file with the BASE_INCLUDE_PATH define using a relative path ... ie. <? include('./init.inc'); ?> --Joe On Sat, Nov 17, 2001 at 05:15:02PM +0100, Mitja Pagon wrote: > Hi! > > I want to know if there is a way to include(require) a file using a path > relative to web server root. > > I'm aware of the fact that you can specify include path, but I believe that > this is not the best solution, since applications written that way aren't > easily portable. > > What I'm looking for is something similar to what "/" does in HTML paths and > SSI include directives. > > Thanks, > > Mitja Pagon > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net Joe Stump <joe@joestump.net> ------------------------------------------------------------------------ "How would this sentence be different if pi equaled 3?"

« previous php.general (#75046) next »