1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What are .inc files?

Discussion in 'PHP' started by muftdagyan, Aug 8, 2011.

  1. #1
    I have downloaded a opne source php script of ecommerce,I can see many files ending with .inc
    like menu.inc,register.inc and many more.
    What will .inc file type do,Does it work same like .php or is it different? 
    thanks 
     
    muftdagyan, Aug 8, 2011 IP
  2. The Webby

    The Webby Peon

    Messages:
    1,852
    Likes Received:
    30
    Best Answers:
    1
    Trophy Points:
    0
    #2
    .inc are simply php/HTML files with .inc extension
    .inc stands for include, These file would have been included (with include, include_once, require or require_once) in the main php files.

    If its a php file, it works just like php...
     
    The Webby, Aug 8, 2011 IP
  3. arpit13

    arpit13 Well-Known Member

    Messages:
    294
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #3
    .inc files are ASP files. but sometimes they r used as php too.
     
    arpit13, Aug 8, 2011 IP
  4. ColorWP.com

    ColorWP.com Notable Member

    Messages:
    3,121
    Likes Received:
    100
    Best Answers:
    1
    Trophy Points:
    270
    #4
    I've seen them in PHP scripts as included files, classes or libraries (e.g. config.inc, connect.inc and more).
     
    ColorWP.com, Aug 8, 2011 IP
  5. Andre91

    Andre91 Peon

    Messages:
    197
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    0
    #5
    .inc files are simply text files that most likely contains HTML markup etc, but the .inc is normally used to signify it as an included file.
    The can have any extension such as .ass .dick .sex etc, but like I said .inc is like the standard / popularized and most suited way as marking a file as an include.
     
    Andre91, Aug 8, 2011 IP
  6. achraf52

    achraf52 Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    It would mean Include and could contain any language and to work it would be included in other script, this is good if you want to easily see the code in browser but dangerous because other visitors could easily see your internal code which is bad for your PHP code rights .
     
    achraf52, Aug 8, 2011 IP
  7. baligena

    baligena Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Last edited by a moderator: Aug 8, 2011
    baligena, Aug 8, 2011 IP
  8. The Webby

    The Webby Peon

    Messages:
    1,852
    Likes Received:
    30
    Best Answers:
    1
    Trophy Points:
    0
    #8
    Absolutely.. If your server is not configured to parse .inc files as php (or asp or whatever language you are using) It will force download for every inc file. thus exposing your critical code to visitors. Its not advised to put your critical app logic in any file that's not treated by server as php files.
     
    The Webby, Aug 8, 2011 IP
  9. ausrixy

    ausrixy Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    1
    Trophy Points:
    0
    #9
    these are just extra files that are included by the main files of your script. They can be any language really, you need to tell your server which language they are for them to be parsed correctly
     
    ausrixy, Aug 10, 2011 IP
  10. ZeroGamma

    ZeroGamma Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    The extension does not specifically mean anything, but it is a recommendation that it is an include(d) or includable file.

    It is a naming convention often associated with PHP development, but do make sure to check the contents of the file to identify the language used.
     
    ZeroGamma, Aug 11, 2011 IP
  11. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #11
    .inc is an include file in PHP, its a naming convention.
    it's a best practice to use this because you will know if a certain file can be included or not.
     
    JohnnySchultz, Aug 12, 2011 IP
  12. freelanceinphp

    freelanceinphp Member

    Messages:
    134
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    48
    #12
    .inc is include file in php, php can interpret it, Coder can easily identified included file from file list.
     
    freelanceinphp, Aug 12, 2011 IP
  13. iBank ™

    iBank ™ Peon

    Messages:
    63
    Likes Received:
    4
    Best Answers:
    1
    Trophy Points:
    0
    #13
    .inc is just a custom file extension describing the file and is not directly related to PHP or any other particular scripting or programming language.
     
    iBank ™, Aug 16, 2011 IP
  14. Vietto

    Vietto Peon

    Messages:
    3
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #14
    *.inc - overlay files. Include in PHP scrypt - Ex. include ("sub_prog.inc");
     
    Vietto, Aug 17, 2011 IP
  15. Sonamseo

    Sonamseo Member

    Messages:
    206
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    28
    #15
    .inc stands for include which has include_once and require_once file.
     
    Sonamseo, Aug 17, 2011 IP
  16. phpgod

    phpgod Member

    Messages:
    62
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #16
    I would suggest you to make an include folder and put all the files that will be included in other scripts there, while keeping them as PHP file not .inc .In this way ,there's no security issue and all include files stay organized .
     
    phpgod, Aug 18, 2011 IP
  17. Rukbat

    Rukbat Well-Known Member

    Messages:
    2,908
    Likes Received:
    37
    Best Answers:
    51
    Trophy Points:
    125
    #17
    baligena3 is correct, but the easy solution to eliminate the security problem and keep "inc" in the name is to name those files xxx.inc.php. That way you'll know that they're included files but the server will see them as PHP files, try to execute them (if the user tries to go to them directly) and probably blow up and throw an error. You can make sure it does by making sure that there's some variable defined in the file that's including the include file.

    (Using an "include" directory will work - if it's made secure. But that directory could be just as insecure as the root directory, so the security issue would remain.)

    Having files with an .inc extension would make me not want to use the program until I'd rewritten it (if it was really worth rewriting).
     
    Rukbat, Aug 22, 2011 IP