note 25939 added to function.getcwd
| From: | lordi at msdi dot ca dot no dot spam dot net | Date: | Fri, 11 Oct 2002 19:10:55 +0000 |
| Subject: | note 25939 added to function.getcwd | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37954@lists.php.net to get a copy of this message | ||
Hmmm there is an issue I just found...
Let say you have a structure like this (win32)
d:\inetpub\www.domain.com\subdir\testfile.php
The user foo has access to /subdir only...
The user foo2 has access to all the drive
The testfile.php contains only:
<? php
$curdir = getcwd();
echo $curdir;
?>
The output for user foo wich doesnt have access to the full file root will be
"c:\winnt" So if like me you wanted to include a file based on the curdir value, you will
have some problems ;)
The output for user foo2 will be correct
ie: d:\inetpub\www.domain.com\subdir
You can bypass this problem using
print(dirname(__FILE__)); instead wich will work for both users
--
http://www.php.net/manual/en/function.getcwd.php
http://master.php.net/manage/user-notes.php?action=edit+25939
http://master.php.net/manage/user-notes.php?action=delete+25939
http://master.php.net/manage/user-notes.php?action=reject+25939