1 Nov 2002 01:04
storing inc.php outside doc root/security/includes
rolf vreijdenberger <rolfvreijdenberger <at> hotmail.com>
2002-11-01 00:04:46 GMT
2002-11-01 00:04:46 GMT
this is how it is done: include ($_SERVER['DOCUMENT_ROOT'].'/../sensitivedata.inc.php'); explanation: suppose i have a file: www.mydomain.com/file.php on the server it could be : /home/sites/site168/web/file.php this file wants to include a file with sensitive data, (or just download some other files ) that should not be in the root (accessible via the web) so I store this files in this directory, one higher than the doc root /home/sites/site168/ like this /home/sites/site168/sensitivedata.inc.php it is now inaccesible via the web in a direct way, but not indirectly, through other php scripts. you include it in the way described above: include ($_SERVER['DOCUMENT_ROOT'].'/../sensitivedata.inc.php'); $_SERVER['DOCUMENT_ROOT'] quote php manual "The document root directory under which the current script is executing, as defined in the server's configuration file." hope to have helped you all -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php(Continue reading)
RSS Feed