using PHP..
thanks
Printable View
using PHP..
thanks
the root directory?
?Quote:
chroot
(PHP 4 >= 4.0.5)
chroot -- change the root directory
Description
bool chroot (string directory)
Changes the root directory of the current process to directory. Returns FALSE if unable to change the root directory, TRUE otherwise.
Note: It's not wise to use this function when running in a webserver environment, because it's not possible to reset the root directory to / again at the end of the request. This function will only function correct when running as CGI this way.
Would it be possible to do the equivalant of a "ls" command and see whether or not ".." shows up in the list?
like if the files for your server were in e:\site, the root dir would be site/.Quote:
Originally posted by da_silvy
the root directory?
?
i don't think you can :(
Try looping thru and displaying all the environment variables and see what shows up.
thanks guys. is there an equivalent of Server.Mappath in PHP?
yes, using pear
Have a look on www.php.net
but it's hard to tell if it's your accounts root directory or your providers :rolleyes:
Well why not put a text file in the root directory, then check is that file exists in your script.
You need PEAR though ;)PHP Code:include_once 'File/Find.php';
list ($directories, $files) = File_Find::maptree('c:/base/dir');