Help - Search - Members - Calendar
Full Version: Flat File Level?
Zymic Webmaster Forums > Web Design & Development > Server Side Scripting > PHP
monteverest
I'm a newbie trying PHP and interested in creating a flat file one level above the root. is this possible on this host? or is there another way to create a secure flat file?
Ed
Well you can't move beyond your home directory, but you can prevent access to the file with a .htaccess in the directory you want to protect with the following:

CODE
Order allow,deny
Deny from all


Any request to access that file will result in a 403 'forbidden' error.
Jordan Parker
Why is it that every coder i know (Excluding me) love HTACCESS so mutch. You could also change the permissions of the file.
And " Bread " you forgot on thing to put in that code
CODE
<files /includes/flat-file.txt>
Order allow,deny
Deny from all
</file>
Ed
Our hosting doesn't allow 'Files' blocks, so I omitted it on purpose. If you're just protecting a directory, there's not much use to the 'Files' block, just put the .htaccess in the directory.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.