10wt308 Posted April 12, 2013 Report Share Posted April 12, 2013 When using INCLUDE is there an advantage or disadvantage to using .inc extension as opposed to .php. What do y'all use as an extension? What are the pros and cons? Thanks Tom Quote Link to comment Share on other sites More sharing options...
Andrea Posted April 12, 2013 Report Share Posted April 12, 2013 I have not studied this topic, so I cannot promise that mine is the only or correct answer, but I use .inc just so I immediately see what I'm looking at when I work in my files. Quote Link to comment Share on other sites More sharing options...
10wt308 Posted April 12, 2013 Author Report Share Posted April 12, 2013 Thanks Andrea I don't mean to be dense but can you explain a little more Quote Link to comment Share on other sites More sharing options...
Andrea Posted April 12, 2013 Report Share Posted April 12, 2013 I just mean when I work on the files of my site - since all the includes will be named whatever.inc and all the actual pages are somepage.php, I'll immediately know what I'm working on without thinking or checking. To me, this is just a small thing that helps me keep it simpler. But as I said, if there are any deeper, more technical reasons to chose one over the other, I'm not aware of them, and I have never bothered to research. Quote Link to comment Share on other sites More sharing options...
10wt308 Posted April 12, 2013 Author Report Share Posted April 12, 2013 Got it now and that is why I started using .inc . Some of the .inc files might be a paragraph of text that may be changed on a regular basis. Thanks for your time Tom Quote Link to comment Share on other sites More sharing options...
newseed Posted April 12, 2013 Report Share Posted April 12, 2013 There's really no real advantage one over the other. However, I agree with Andrea thus this allows you to keep your pages and includes seperate making the obvious as to what they are. .inc seems to be the most common to using include files but you can certainly use other extensions such as .html, htm, php, .txt, etc. If you work with .asp on Windows server the same thing applies except you have to .asp instead of .php. In rare cases I have using .asp and php together on a Windows server and use one common include to run both .asp pages and php pages. Quote Link to comment Share on other sites More sharing options...
10wt308 Posted April 12, 2013 Author Report Share Posted April 12, 2013 Thanks y'all I think this will help clean up my file structure. Thanks again for all your help. I don't post much but I read your advice quite often and have learned a lot on this site. Quote Link to comment 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.
Note: Your post will require moderator approval before it will be visible.