Forum Moderators: coopster
I have a series of static html pages with a .PHP extension. The reason for this is that some other dynamic part of the site requires it for includes.
Anyway, I am about to include some separate ssi elements in these pages. Thing is, I have found that using the .SSI extension on these includes seems to work just fine when I use the following code - which Dreamweaver was kind enough to generate for me. ;)
<?php require_once('../../subdirectory/thisfile.ssi');?>
But I'm wondering whether I should be using a .php extension for these includes. E.G.
<?php require_once('../../subdirectory/thisfile.php');?>
Is there any reason why I should be using one over the other?
Thanks.
if it is only for includes then it doesn't matter
but..
I always prefer to have a php extension as then if someone did call that file on it's own it would still get parsed and not show the code. Though you could just add .ssi in httpd.conf to be parsed by php.
For included files I often use .inc.php then I know that those are included files that are not used individually.
As long as you figure out a naming convention and stick to it then you'll be fine.