|
Posted by Jerry Stuckle on 04/27/06 16:29
Garry Jones wrote:
> "Jerry Stuckle" <jstucklex@attglobal.net> skrev i meddelandet
> news:eIOdnRkcYd5i3c3ZRVn-gA@comcast.com...
>
>
>>Simply put them outside of your DOCUMENT_ROOT where they can't be accessed
>>directly by a browser.
>
>
> How do I do that?
>
> (Excuse the newbie follow up question. I searched around in Google but can't
> quite grasp this).
>
> Thanks to you and all others who answer my questions here, I am enlightened.
>
> Garry Jones
> Sweden
>
>
>
The document root id the root directory of your website. But it is not the root
directory of your machine. For instance, your document root might be
"/var/www/website1/html".
When you upload them, put them in a directory below the root of your website,
i.e. "/var/www/website1/myfiles". You can then include this page in your
other PHP pages with something like (assuming Apache):
include($_SERVER['DOCUMENT_ROOT'] . '/../myfiles/my.inc.php');
Anyone accessing a page through http protocol can only access those files in
your web root. But PHP accesses the file system directly, so it can access any
file on the system (assuming the appropriate permissions are set).
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================
Navigation:
[Reply to this message]
|