Page 1 of 1
What is an .inc file
Posted: Thu Mar 24, 2005 6:09 am
by bladecatcher
G'day Guys,
What is an .inc file?
Yep, I know it's interchangable with .php, I've tried it and I've googled a lot but why .inc and not .php?
any links *or* keywords to help me get my head around this appreciated.
tia
bladecatcher
Posted: Thu Mar 24, 2005 6:10 am
by onion2k
An include file. Its not interchangable with .php .. .inc (usually) isn't parsed as PHP.
Posted: Thu Mar 24, 2005 6:19 am
by anjanesh
At first I thought .inc is parsed by PHP. But I had my files like xxx.php.inc. Using IIS, if the extension is inc which is not a valid php file. But using Apache (Windows and Linux), somehow it parses as php. In fact, in Apache, any file having .php anywhere (not necessarily at end) will be parsed as php.
This is how its working on my PC and web host.
Posted: Thu Mar 24, 2005 6:38 am
by CoderGoblin
Normally use can use .php for core code. If a php file contains "include <filename>;" these <filename>'s are frequently named *.inc to indicate that the file is included into one or more .php files. This is purely a user convention.
How they get processed if referenced via url is dependant upon your server settings.
Posted: Thu Mar 24, 2005 7:13 am
by Maugrim_The_Reaper
Some may use .inc.php - simply to ensure it is parsed correctly. .inc is simply a user preference - something to mark that a file is included into other PHP files, and not necessarily directly accessible (or accessible in any meaningful way) by a browser.
Posted: Thu Mar 24, 2005 7:45 am
by Chris Corbyn
Maugrim_The_Reaper wrote:Some may use .inc.php - simply to ensure it is parsed correctly. .inc is simply a user preference - something to mark that a file is included into other PHP files, and not necessarily directly accessible (or accessible in any meaningful way) by a browser.
I just keep all my include files as .php but under an "includes" directory. As you say it's just a preference.
Posted: Thu Mar 24, 2005 8:16 am
by JayBird
be careful storing sensitive information inside a *.inc file as the raw data will be display in the browser if the user navigates directly to that file.
IMO, if you wanted to distinguish between include files using the filename...i would do...somescript.inc.php