RE: [PHP-WIN] Real path through aliases
| From: | Wu, Jin Yong | Date: | Sun, 08 May 2005 02:16:30 +0000 |
| Subject: | RE: [PHP-WIN] Real path through aliases | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-25980@lists.php.net to get a copy of this message | ||
Through URL you can't determine the real path UNLESS your script returns
some URL information.
So that it can prevent hacker knowing some useful information about server
to guarantee the web
server's security.
In PHP scripts, you can use __FILE__ to get real path or dirname(__FILE__)
to get real directory.
Hope it's helpful for you.
Regards,
Yong from Xerox, China
2005/5/8
-----Original Message-----
From: Liam [mailto:drake.mobius@gmail.com]
Sent: Wednesday, May 04, 2005 22:51 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Real path through aliases
Hi,
I'm running PHP 4.3 and Apache 2, trying to figure something out.
Is there a way from PHP to determine the real (harddrive, not URL) path
being accessed by a URL? For example, if I want to know where on my
harddrive http://localhost/web/ is, it's going to be
DOCUMENT_ROOT/web, and
I can make that work using REQUEST_URI for anything under my document root
However, some of my folders are apache folder aliased to other parts of my
harddrive. Example, http://localhost/music is actually f:/my
documents/music/
Is there any way to let PHP figure this out automatically, without having to
hardcode my script to look there every time?
I really appreciate any answers you might have
Thanks,
Liam
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php