RE: [PHP] Accessing upper directory of public_html directory

From: Date: Wed, 24 Jul 2002 03:25:59 +0000
Subject: RE: [PHP] Accessing upper directory of public_html directory
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-109204@lists.php.net to get a copy of this message
> I bought a web host service from a company named easyspace.com. I have > tried to ask them this question many times but until now there is no > response from them at all. > According to the security issue of placing password in script I brought > up > days ago, some one on this news group suggested me to place such script in > directory above %public_html directory. The problem is I do not know how > to > access such directory. Is it because the service I bought does not allow > me > to do it? or if it is accessible, how to do it? Just use include() or require() to "include" the file into your script. You can provide a full path to the file (above the web root) or use a relative path according to the file that's doing the including. Say you using a script in your webroot and you want to include a db.php file that's in an include/ directory above your web root. You can use: include("/home/full/path/to/your/dir/include/db.php"); Or include("../include/db.php"); ---John Holmes...

« previous php.general (#109204) next »