RE: [PHP] include("../file.inc");

From: Date: Fri, 11 May 2001 10:52:17 +0000
Subject: RE: [PHP] include("../file.inc");
Groups: php.general 
Request: Send a blank email to php-general+get-52442@lists.php.net to get a copy of this message
Either of the first two should work under linux. I have done similar many times myself e.g. require_once "../common/localvars.php"; -Stewart -----Original Message----- From: Matthew Ralston [mailto:matthew.ralston@haltoncollege.ac.uk] Sent: 11 May 2001 11:40 To: php-general@lists.php.net Subject: [PHP] include("../file.inc"); How do you include or require a file that is above the current script in the directory hierarchy? For example how would I include or require a file whose path is "../file.inc" relative to the current script? I tried all of: include("../file.inc"); require("../file.inc"); include("/file.inc"); require("/file.inc"); include("..\file.inc"); require("..\file.inc"); include("\file.inc"); require("\file.inc"); but it doen't like any of them. :( I don't want to use a full path relative to the root of the drive or webserver folder because the included file and the script may move as the development server is setup differently to the real web server. Any ideas? -- Thanks, Matt matthew.ralston@haltoncollege.ac.uk < www.mralston.co.uk /> -- 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 (#52442) next »