zgkhoo Posted October 30, 2007 Share Posted October 30, 2007 include('hello.inc') eg like this code how can i create a *.inc and wat purpose of an *.inc for? thanks first Quote Link to comment https://forums.phpfreaks.com/topic/75303-wat-is-an-inc-for-how-to-create-it/ Share on other sites More sharing options...
sKunKbad Posted October 30, 2007 Share Posted October 30, 2007 an inc file is just another php file but with the inc extension. You shouldn't use inc as your file extension unless you are sure that your php will process them, otherwise people may be able to view your script. You should probably use something like "include.inc.php" instead. Quote Link to comment https://forums.phpfreaks.com/topic/75303-wat-is-an-inc-for-how-to-create-it/#findComment-380848 Share on other sites More sharing options...
teng84 Posted October 30, 2007 Share Posted October 30, 2007 inc stands for include but you can change it to anything that comes up in your mind using .inc etc.. give a text file not php file thats is why as mentioned it is accessible and bad practice i'd say Quote Link to comment https://forums.phpfreaks.com/topic/75303-wat-is-an-inc-for-how-to-create-it/#findComment-380855 Share on other sites More sharing options...
cooldude832 Posted October 30, 2007 Share Posted October 30, 2007 an inc file is just another php file but with the inc extension. You shouldn't use inc as your file extension unless you are sure that your php will process them, otherwise people may be able to view your script. You should probably use something like "include.inc.php" instead. It isnt' technically a "php file" it is a file in general. You can't be any more descriptive than a file, as the extension does not have any certified default application such as a .dll file or a .ini or a .php or .html, .js etc. It is an arbitrary extension generally used for inclusion files similar to a library file in a C/C++ development. Its extension has no correlation to the content to it, but it is assumed that it is an include file containing data that will be support to php. I could call it a .animal file if I wanted or a .stupidfile it doesn't matter (yes there is a limit to an extension size that is readable by most systems I know). I'm just trying to state it is nothing more that data assigned to a location that has a defined character. The applications of this data are unknown, until it is used someway. It is a dependent file as it can not run on its own 90% of the time. As stated above it is dangerous using the disambiguous file extensions as the default settings in most apache configs is to simply apply a generic text file assocation with a file that has an unassigned extension in a public folder, allowing as stated above unprocessed viewing of what you think is protected. Quote Link to comment https://forums.phpfreaks.com/topic/75303-wat-is-an-inc-for-how-to-create-it/#findComment-380891 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.