RE: Real path through aliases

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx]
Sent: Wednesday, May 04, 2005 22:51 PM
To: php-windows@xxxxxxxxxxxxx
Subject:  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

-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux