Go up the root directory. Simple

I have my includes folder on public_html. I want to hide it so I’m moving up one folder to the root directory where noone can access it but me. I have this

require_once($_SERVER['DOCUMENT_ROOT'].'/includes/beginning.php');

I want to change that to make it to the root. I’ve tried variations of …/ to move up but I can’t find what works.

Does the following work?

require_once($_SERVER['DOCUMENT_ROOT'].'/../includes/beginning.php');

If not, then try echoing out the path to see if it matches the directory tree.

For my localhost that would equate to
C:/Apache2.2/htdocs//includes/beginning.php

Not very helpful.

If you know you will always be calling from the same depth something like this should work (eg. from the top level public dir)
../nohttpaccess/confidentialstuff.php

i.e. go up one level (out of public_html) then go into the nohttpaccess folder

Bingo. Thanks.