Posted by Toby Inkster on 01/09/07 16:02
Daz wrote:
> I am a little stumped at why when I try to include a file in same
> directory as the script being processed, it looks in the same directory
> as the script that included it to begin with. Is there any way I can
> get around this?
include dirname(__FILE__).'/myfile.php';
However, it's a good idea to have a specific "includes" directory, put all
your included files into there and then just refer to them as:
include 'myfile.php';
without including a directory path at all(!) but instead using the
include_path setting to specify where include files will be found.
http://www.php.net/manual/en/ini.core.php#ini.include-path
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Navigation:
[Reply to this message]
|