سؤال

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