![]() |
|
|
|
|
|
|
|
|
8
30th October 20:34
External User
Posts: 1
|
Jochem was nearly right in an earlier reply. The CWD is usually set to
the directory that contains the initial script. It does not change when you include a file. This affects include, require and file functions. If you want to reference a file relative to the current script regardless of what the CWD is, use dirname(__FILE__) to prefix the script. For example... include dirname(__FILE__).'/config.php'; There are other ways to handle this. The one I tend to use is to change include_path to contain the root directory for your scripts. That way you can reference all include files as relative to that directory without worrying about where the initial script is/was. -Stut -- http://stut.net/ |
|