immanuelx2 Posted June 17, 2007 Share Posted June 17, 2007 I've seen some code with: require "dbconnect.inc.php"; when/why name a file .inc.php, and not just .php? Quote Link to comment https://forums.phpfreaks.com/topic/55972-incphp/ Share on other sites More sharing options...
pocobueno1388 Posted June 17, 2007 Share Posted June 17, 2007 Take a look at this post on another forum site: http://www.thescripts.com/forum/thread1755.html ...not sure if that will answer your question or not. Quote Link to comment https://forums.phpfreaks.com/topic/55972-incphp/#findComment-276462 Share on other sites More sharing options...
Gamic Posted June 17, 2007 Share Posted June 17, 2007 It's a convention to show that "this" file needs to be included to be useful. (config information, classes, etc etc.) Quote Link to comment https://forums.phpfreaks.com/topic/55972-incphp/#findComment-276463 Share on other sites More sharing options...
pocobueno1388 Posted June 17, 2007 Share Posted June 17, 2007 Yeah, from what I got from the other post it is just an easy way to differentiate between file types and what they are used for. So it isn't something thats required, but I guess it would be appropriate if you had a large application that had a lot of side files that you had to include. Quote Link to comment https://forums.phpfreaks.com/topic/55972-incphp/#findComment-276464 Share on other sites More sharing options...
GingerRobot Posted June 17, 2007 Share Posted June 17, 2007 Yeah, it is just a way to show that the file gets included. Although you could just name it file.inc, unless your server is set up so that php will parse files with extensions of .inc(and even then you get portability issues), then it tends to be a security issue. Often includes may contain sensitive data (database connection info etc) and just giving the file the extension .inc could allow someone to view the file in plain text. So, people name it file.inc.php, so it is still always parsed by php, but also shows that its an included file. Quote Link to comment https://forums.phpfreaks.com/topic/55972-incphp/#findComment-276467 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.