"Bruno Desthuilliers" <bd***********@removeme.free.fr> wrote in message
news:3f***********************@news.free.fr...
Gary Petersen wrote: On Sun, 14 Sep 2003 22:36:24 -0500, Joshua Ghiloni created an
award-winning crop circle <bk**********@eeyore.INS.cwru.edu>, which,
when translated into English, means this:
ConTactMe wrote:
Is it necessary to have your file named *.php to use PHP code in it,
such as for includes? Can't any extension be used?
Thanks
Any extension can be used. I often use .inc myself.
But it's safer to use .php because many web servers
are configured not to process .inc files. If a browser
requests the file, the server will send it in source
code form.
... Behaviour that you can prevent by using the server's authorization
mechanism (ie : .htaccess for Apache).
Using .php extensions prevents the server from displaying source code,
but not from executing it, which may not be such a good idea.
Bruno
I tend to use .inc files in cases where I control the httpd.conf file and
can stop these files being displayed.
In the case where you do not control the webserver, a method I have used is
to call my files .ht_php_something
the "dot" ht is generally not output via the webserver - ala .htaccess
..htpasswd
Test it on the server you are using.
The best method of course is to use whatever extension you like and not have
the file in the web server path.
Bob