Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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

Posted

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.

Posted

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.

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...