note 83454 rejected from function.require by tularis

From: Date: Tue, 27 May 2008 12:35:04 +0000
Subject: note 83454 rejected from function.require by tularis
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-139849@lists.php.net to get a copy of this message
Note Submitter: freemanlatif at hotmail dot com ---- can you actually 'execute' scripts (just like using require() ) but make them run at their own locations. e.g. root/index.php: <?php //This should give out a 'hello world' require 'jack/reader.php'; ?> root/jack/reader.php: <?php require 'helloworld.php'; echo $hello; ?> root/jack/helloworld.php: <?php $hello= "Hello World!" ?> I know it wont work. So what should I do to make them work without altering the target location (e.q. adding a '../'). Is there a more efficient function?

« previous php.notes (#139849) next »