Erik Price wrote: > > On Thursday, February 14, 2002, at 04:40 PM, Michael Kimsal wrote: > >> On that same topic, *why* do people name files with both .inc and >> .php? Your .inc file has PHP code in it, right? Why not just call it >> .php and >> spare the server reconfiguration. If knowing which files are >> "include" files (long time since I've made that distinction!) just >> prepend >> them with inc_ or put them all in an includes/ directory. > > > If you are including a file into another file with PHP's 'include()' > function, it doesn't matter what the extension is. You don't even need > an extension. Apache doesn't even see this as a separate file, it > thinks of it all as one big file with the name of whichever file is > doing the including. > > Giving the .inc suffix is a nice way to keep your code organized. Also, > I keep my .incs in a separate directory. > > Not to mention I have a directive in my server's conf file that > specifically prevents it from serving any file with the extension '.inc'. >
That's great for you that you have that luxury, as do I, but not everyone has access to their server's conf file. 'Organizing' would be better served with the separate directory and/or a prepend, because most directory structures are sorted by name by default. I replied privately to someone on this already, but I'll post it here as well. The majority of people learning PHP do so by examining other code, and a great many do so in shared hosting environments where they can't control the server config files. Furthermore, because they are new they don't understand the security implications of .inc or other extensions, and blindly copy code and run it without knowing they are exposed security-wise. That's my primary beef with .inc and other non- ".php" extensions. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php