note 39314 deleted from function.realpath by aidan
| From: | aidan@php.net | Date: | Sun, 29 Aug 2004 21:50:11 +0000 |
| Subject: | note 39314 deleted from function.realpath by aidan | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-75603@lists.php.net to get a copy of this message | ||
Note Submitter:
----
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\