Pergunta

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.

Foi útil?

Solução

Try this.

realpath(dirname(__FILE__).'/../../../contents/nav/quicklinks.txt');
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top