Another option is to place the files outside of your web root. The
include files can be anywhere on your machine, you just have to give a
good path when you include() them. If they are outside of your web root,
then they can never be called up in a browser.

Last option is to name the files with a .php extension, but this should
only be used if absolutely necessary. The reason it's a problem is that
your file can be called by itself and executed "out of context." This
may or may not be a big deal, depending on what you've got in the file.
If you only put functions or classes inside of includes, with no code
outside of the functions, then naming them with a .php extension doesn't
pose a problems.

---John W. Holmes...

PHP Architect - A monthly magazine for PHP Professionals. Get your copy
today. http://www.phparch.com/

> -----Original Message-----
> From: Sunfire [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, February 02, 2003 6:08 PM
> To: Justin French; [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: Re: [PHP] including files...
> 
> how do you tell it to refuse file.inc with a .taxis file? the server i
> will
> be running this on is a public server and they dont allow .taxis files
i
> dont think...i will have to check and see
> 
> ----- Original Message -----
> From: "Justin French" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "'Sunfire'" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Sunday, February 02, 2003 5:46 PM
> Subject: Re: [PHP] including files...
> 
> 
> > on 03/02/03 5:28 AM, John W. Holmes ([EMAIL PROTECTED])
wrote:
> >
> > > Pretty much. Only addition is to make sure filename.inc can't be
> viewed
> > > through the browser.
> >
> > ... by having apache refuse to server all .inc files through http,
via
> the
> > use of a .htaccess file (assuming apache server)
> >
> > Cheers,
> >
> > Justin
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> 
> 
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.443 / Virus Database: 248 - Release Date: 1/10/2003
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to