I'm using PHP File Tree to build a directory for a site, and I'm curious what alternatives I have to $_SERVER['DOCUMENT_ROOT']
to make the argument I'm passing through to a function become relative.
The page that calls the function is within the directory I am using the function on, so normally $_SERVER['DOCUMENT_ROOT']
would be perfect except my virtual host is using that directory as the root directory for a domain name.
So, for example, my server/hosting address is http://s389593949.servername.com
but the domain www.heresmysite.com
resolves to http://s389593949.servername.com/HERESMYSITE/
, so the document root when used in the function returns www.heresmysite.com/HERESMYSITE/therealfile.file
when it should be www.heresmysite.com/therealfile.file
.
Is there something I can put in place of $_SERVER['DOCUMENT_ROOT']
to make it relative? Something like "/"
or "../HERESMYSITE/"
so when the file name and link are appended they are correct to the relative path? Those do not work.
(Yes, I am aware I can modify the PHP of the function itself, but I'm hoping to leave that untouched as I wish to use it in the future for other applications)
Many thanks, SO.