Php File outside of root

csw

Verified User
Joined
Dec 29, 2010
Messages
6
Hello!

I am having a small problem and I am hoping someone can help.


Basically, I have a php file that I do not want to be accessed by the public, so I would like to put it above the public_html folder.

I have read that it is possible to do this; however, I am having some trouble linking to the file.

If I have test.html in the public_html folder, and I am trying to link to a file that is in the same directory as public_html, what would my path look like? "/../myhiddenphpfile.php" does not seem to work.


Thank you in advance, I have full server admin to my directadmin. :)
 
You should use the absolute path of your PHP file
/home/user/domains/users.com/public_html/ etc.
 
The webserver cannot go outside of documentroot theres no way its gonna work.
 
Back
Top