|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
When Must I Use ".inc" Suffix Instead Of ".php" Suffix?
::Question::
I have been using an "includes" file to include a table into a page. In order to get the "includes" file to work the way I want it to work on my server I must treat the file as if it were a PHP file and use a ".php" suffix instead of an ".inc" suffix. The ".php " suffix seems to work fine. My question is this: Is there a specific reason why or instance where I must use the ".inc" suffix instead of the ".php" suffix for "includes" files? Thank you in advance. Volitics |
|
#2
|
|||
|
|||
|
Hi,
The .inc extension is often used to point out that the file should be included, and not loaded directly. There's really no good reason to use .inc. You should always end your file names with .php. If you don't use the .php extension, for example apache won't send the file to the php parser, which in return makes it print out the content of the file as clear text (displaying all your source code). Although it IS possible to make apache treat the .inc files as .php files, it's not standard, and is therefore discouraged. If you really really really want to use .inc, you could use .inc.php instead.. ![]() Hope that answers your question
__________________
Best Regards, Håvard Lindset |
|
#3
|
|||
|
|||
|
Thank you for the help.
Mr. Lindset;
Thank you for your kind response. Regards; Volitics |
|
#4
|
|||
|
|||
|
i usually make all my files i need included inside an 'include' directory with a .inc.php extension, my server has no problems interpereting it.
so... somefile.inc.php works fine
__________________
![]() ![]() "Only Linux users see the end of crashes." - Pl4t0 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > PHP Development > When Must I Use ".inc" Suffix Instead Of ".php" Suffix? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|