note 39314 added to function.realpath
| From: | php-general at lists dot php dot net | Date: | Sat, 24 Jan 2004 01:45:13 +0000 |
| Subject: | note 39314 added to function.realpath | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-64095@lists.php.net to get a copy of this message | ||
I am using IIS5.1 and php. To use php with virtual directories is easy.
$server = $_SERVER['SERVER_NAME'];
returns whatever ip/name the user used to access the site.
example will be http://localhost/
$serverself1 = $_SERVER['PHP_SELF'];
returns the virtual directory of the current file. example will be /search/
$serverself = $server.dirname($serverself1)."/";
Puts it all together.
returns /localhost/search/
realpath($serverself)
returns c:\inetpub\wwwroot\searchingprogram\
----
Manual Page -- http://www.php.net/manual/en/function.realpath.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+39314
Delete -- http://master.php.net/manage/user-notes.php?action=delete+39314&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+39314&report=yes
Search -- http://master.php.net/manage/user-notes.php