Re: php include - above root directory
I lol'd :p
If you want to "secure" a script, don't put it in public_html at all, you can put it even higher than that. (eg. make a directory nonpublic_html)
As vishal2 (finally) noticed in the end, you can use absolute paths ("/home/username/public_html/script.php" for example), or perhaps easier: relative paths can do this too.
To refer to the directory above the one you're currently in, use "..".
So, if you have a script in public_html/site.com and want to refer from there to a script public_html/nonpublic/script.php, you can use
PHP Code:
include "../nonpublic/script.php";
Edit: sorry, too late
Last edited by marshian; 01-10-2010 at 06:18 AM.
Real programmers don't document their code - if it was hard to write, it should be hard to understand.