Question

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.

Était-ce utile?

La solution

Try this.

realpath(dirname(__FILE__).'/../../../contents/nav/quicklinks.txt');
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top