I can read a file below the root directory ok, by using "../../../test.php" but was wondering if it could be done without "../../../" so I don't have to calculate how many "../"s to use?
Something like $_SERVER['DOCUMENT_ROOT']; then go one lower. I suppose I could put the calling file's pathinfo into an array and count how many directories up it is, but was hoping there maybe an easier way to automate it? ----- Original Message ----- From: "lokrin" <[EMAIL PROTECTED]> To: <[email protected]> Sent: Sunday, December 11, 2005 10:30 PM Subject: Re: [php-list] Read a file below root > My Linux system is boxed up for shipping, so I can't get to it right > now, however, I had a slight problem when I started running my website > on it for testing. The home directory was /home/user/www/www and I had > a sub domain of /home/user/www/weblog. I couldn't get to it at first > because of the backing up past the webroot directory of of > /home/user/www. I found out I could configure apache to tell it that > references to /home/user/www/www/weblog actually meant > /home/user/www/weblog and things worked fine. You might be able to put > that in an .htaccess file or ask your web provider to do it for you. I > don't remember the exact command that was used, but it's a start in case > someone else here might know. > Lennart Droste wrote: > >>Bob sagte: >> >> >>>Hi. >>>How can I include a file from below the Root dir, other than using: >>>include "../../filename.inc.php"; >>> >>depends on the system configuration you have. if it is a paid webspace you >>have the problem, that you might be able to list the files but you won't >>be able to read them. but if you use this to create a secure source for >>data that should not be accessible through the internet try setting the >>subfolder as the root through your apache-setup. thus the user that >>uploads the file is still the owner of the directory and able to read the >>file. if you are using a paid webspace you could also archieve this by >>setting the root dir to a subfolder if you have confixx access using the >>domain settings. >>-- >>Lennart Droste ------------------------ Yahoo! Groups Sponsor --------------------~--> Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life. http://us.click.yahoo.com/KIlPFB/vlQLAA/TtwFAA/HKFolB/TM --------------------------------------------------------------------~-> Community email addresses: Post message: [email protected] Subscribe: [EMAIL PROTECTED] Unsubscribe: [EMAIL PROTECTED] List owner: [EMAIL PROTECTED] Shortcut URL to this page: http://groups.yahoo.com/group/php-list Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/php-list/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
