문제

How do I access a folder outside my subdomain folder.

For example, my domain is localhost and I have a subdomain m.localhost. And their folders are:

Server Root:
    /cdn/
    /contents/
    /mobile/
    .htaccess

And the folder /mobile/ is the root directory of my m.localhost. From the m.localhost, how do I access the /contents/ directory and it's contents using PHP?

$_SERVER['DOCUMENT_ROOT'] only selects the subdomain directory root.

도움이 되었습니까?

해결책

Try this.

realpath(dirname(__FILE__).'/../../../contents/nav/quicklinks.txt');
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top