Re: Require() using relative path

From: Date: Thu, 20 Jul 2000 02:39:07 +0000
Subject: Re: Require() using relative path
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-7367@lists.php.net to get a copy of this message
well, i guess there is both good and bad points about it. thanks! ----- Original Message ----- From: Mark Roedel <roedelm@letu.edu> To: Ken M. Mevand <geekabyte@yahoo.com>; 02 PHP <php-general@lists.php.net> Sent: Wednesday, July 19, 2000 9:38 PM Subject: RE: [PHP] Require() using relative path > > -----Original Message----- > > From: Ken M. Mevand [mailto:geekabyte@yahoo.com] > > Sent: Wednesday, July 19, 2000 4:37 AM > > To: 02 PHP > > Subject: [PHP] Require() using relative path > > > > > > here is my file layout : > > > > index.php > > |- templates > > | |-default.php > > | |-welcome.php > > > > i called index.php which includes default.php, which in turn includes > > welcome.php. can the 2nd include in default.php be done using > > require("welcome.php") > > > > instead of > > require("templates/welcome.php") ? > > Nope (I just tried), because the "current directory" remains the directory > of the original script (in this case, index.php). > > What you *could* do is add the templates directory to your include_path, > either in your php.ini, or using a .htaccess file. > > > --- > Mark Roedel | "Blessed is he who has learned to laugh > Systems Programmer | at himself, for he shall never cease > LeTourneau University | to be entertained." > Longview, Texas, USA | -- John Powell > > > -- > 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

« previous php.general (#7367) next »