is code are ok or not [PHP]$_SERVER['DOCUMENT_ROOT'].'armese_data/call/call.php'[/PHP] to access the root folder for security from downloading the files by direct url.
access root folder
Collapse
X
-
The root folder of what?
If you want to access the root directory of your Linux system, simply appending / to any path will jump to the root directory
For example: "/var/www/html"
If you want the web-root, meaning the top level directory accessible from your HTTP server, you could do:
Code:$_SERVER['DOCUMENT_ROOT'] . "/path/to/file.ext"
Comment
-
PHP can access any file on the server's file-system, granted that it has the proper permission.
You can use absolute paths with most of PHP's file functions, such as include and readfile.
Like, say, if you had a DB connection script stored in "/var/www/include", you could simply do:
[code=php]
include("/var/www/include/dbConnect.php") ;
[/code]
If your web-root is located at "/var/www/html", and the current script is at the web-root, you could also use a relative path, like:
[code=php]
include("../include/dbConnect.php") ;
[/code]
On Windows, using a path like "C:\\SomeDir\my file.php" should also be perfectly valid.Comment
Comment