I have a site with several sub folders and an include folder in the root:
for example :
www.mysite.com
www.mysite.com/includes
www.mysite.com/includes/inc.php
then a sub folder:
www.mysite.com/sub1/
www.mysite.com/sub1/page.php
in page.php I would like to include the inc.php which is in the includes folder.
Is that possible, and if so, how can i do that? (tried $_SERVER["DOCUMENT_ROOT"] and didn’t work.)
I appreciate the responses, it is quite urgent as I need to move the site to a new server in this format!!!! thanks everyone!
I can’t think of why document root isn’t working but when you do find out, use like this…
Have you tried echoing $_SERVER[“DOCUMENT_ROOT”] to see what it outputs?
Also, run…
<?php phpinfo();?>There should be root path somewhere…