Hello
I have noticed that many people put their php code in .inc files while others put it in .inc files.
Can someone tell me what are the differences between the two methods and when should I prefer one over the other?
thanks
Hello
I have noticed that many people put their php code in .inc files while others put it in .inc files.
Can someone tell me what are the differences between the two methods and when should I prefer one over the other?
thanks
normally you have .inc files to see from the filename whether you inlcude this file or not
i personally always use .php but combined with inc
file_in_browser.php
included_file.inc.php
my_class_for_smtp.class.php
...
You should never, I repeat, never store your PHP code in a file with the extension .inc because if a visitor find the file on your server and view it in his browser, the entire source of the document will be shown to him.
If you want to use .inc to make it clear that the file is included, always use the method mrhappiness is using, combine the .inc and .php extension like this:
functions.inc.php