Hi,
Seems that a lot of tutorials and books use .inc in their examples. But, I noticed one day, that if a user can navigate to the file, then some browsers will either display the contents of the file or possibly open a dialog and ask if you want to open the file or save it locally.
This is only a problem if the 'include' files are in a folder below the websites root folder (where the index page is).
If you use .php for the extension, however, then if a user navigates to the file, it will actually run the contents of the file at the server.
Suppose the file contains a list of functions, classes and variable definitions or even private settings. An error could occur, or maybe not. But whatever happens, the contents won't be displayed in the browser and the 'open/save' dialog won't open.
The best solution to all of this is to put all of your 'include' files in a folder above the root or in a password-protected folder elsewhere. Then you can use any extension!!
Paul 🙂