RE: [PHP] Making your include files invisible (header() in if loo p)
| From: | UGBI) | Date: | Fri, 01 Feb 2002 15:17:02 +0000 |
| Subject: | RE: [PHP] Making your include files invisible (header() in if loo p) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-83131@lists.php.net to get a copy of this message | ||
Or even better put them outside your www root.
> -----Original Message-----
> From: Erik Price [mailto:pricee@hhbrown.com]
> Sent: Friday, February 01, 2002 4:19 PM
> To: qartis
> Cc: php-general@lists.php.net
> Subject: Re: [PHP] Making your include files invisible (header() in if
> loop)
>
>
>
> On Thursday, January 31, 2002, at 11:50 PM, qartis wrote:
>
> > I wanted to hide the existance of my include files by making them
> > 'invisible': give a 404 error when requested. This worked,
> but the files
> > that were including were obviously 404ing too. So I decided to use
> > $PHP_SELF
> > and check whether the script's PHP_SELF was it's filename,
> which would
> > mean
> > that it was being accessed directly, as opposed to being included.
>
> Just don't name any of your real files "include"! If you
> have access to
> your web server, you can easily set a directive in httpd.conf
> (assuming
> you're using Apache) to deny any file serve request with the
> following
> line:
>
> <Files ~ "\.inc$">
> Order allow,deny
> Deny from all
> </Files>
>
>
>
> Erik
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> pricee@hhbrown.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail:
> php-list-admin@lists.php.net
>
The information contained in this email is confidential and
may be legally privileged. It is intended solely for the
addressee. Access to this email by anyone else is
unauthorized. If you are not the intended recipient, any
form of disclosure, production, distribution or any action
taken or refrained from in reliance on it, is prohibited and
may be unlawful. Please notify the sender immediately.
The content of the email is not legally binding unless
confirmed by letter bearing two authorized signatures.