Hi
A newbie(?) question: is correct use ".inc" at final of files for php?
I saw some pages and tried in my server this question.
I found it inside a thread copied bellow.
Best,
Claudio
------
On Sat, 20 Sep 2003 06:39:22 +0000, Phester wrote:
> If a file has a .inc extension, or if it has a .inc.php extension, is it
> treated differently by the php interpreter? Or is it just a convention?
>
> I've been calling my included files filename.php and it doesn't seem to
> hurt anything. Is it wrong to do that?
..php (by default) is the normal extension for files.
..inc was (/ still is?) used normally for files being used in include() or
require() calls that reside on a remote server. Including a .php file from
a remote server causes problems as it's retrieved as a parsed file, so you
only retrieve the HTML output, rather than the PHP code you really want.
As .inc isn't normally assigned in the server configuration, this will
normally return as a text/plain file, meaning that all the PHP code is
available when included.
I've never needed to use .inc files personally for remote retrieval, some
seemed to use it in the earlier days for files include()d regardles of
them being local or remote.. personally I prefer .php wherever I can to
prevent accidental viewing of code.
Regards,
Ian