php-windows Digest 29 Mar 2008 05:40:52 -0000 Issue 3447
Topics (messages 28841 through 28841):
PHP & IIS - defining a path
28841 by: Walter Torres
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
can anyone explain to me why this...
// PHP_SELF = \walter\test.php
// __FILE__ = \\NAWINFS03\home\web\rh.itdoes\walter\test.php
// $_path = \\NAWINFS03\home\web\rh.itdoes
$_path = substr( __FILE__, 0, 0-strlen($_SERVER['PHP_SELF']) );
require_once $_path . DIRECTORY_SEPARATOR . 'config.php';
fails...
Fatal error: main(): Failed opening required [file as defined in $path]
And yes, $path echos what I expect it to.
But this, hard coded definition...
$path = DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR .
'NAWINFS03' . DIRECTORY_SEPARATOR .
'home' . DIRECTORY_SEPARATOR .
'web' . DIRECTORY_SEPARATOR .
'rh.itdoes';
require_once $_path . DIRECTORY_SEPARATOR . 'config.php';
This works fine! ??
But this coded version will *not* work if I use '\' (yes, even escaped).
I really need to get $path dynamically defined.
Can anyone shed some light on this? (Beyond "don't use IIS")
Thanks
Walter
--- End Message ---