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Â
.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...
I've seen them in PHP scripts as included files, classes or libraries (e.g. config.inc, connect.inc and more).
.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.
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 .
I would stick with the .php extension. .inc extension only benefit is recognition when navigating through files in your directory. It also has room for security breach. You can read more about this www.baligena.com/2011/08/inc-vs-php-file-extention.html
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.
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
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.
.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.
.inc is include file in php, php can interpret it, Coder can easily identified included file from file list.
.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.
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 .
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).