This is a discussion on what is .inc file in php within the PHP Language forums, part of the PHP Programming Forums category; hello vishal here. i have seen some scripts which includes file like include('time.inc') so can anyone tell me ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
inc files are "include" files, they can contain functions, classes or
routines that you write. something like "time.inc" would more then likely have a function that generated the time and or date to display on a page. inc files are also used in JaveScript as well. |
|
|||
|
behindspace wrote:
> inc files are "include" files, they can contain functions, classes or > routines that you write. something like "time.inc" would more then likely > have a function that generated the time and or date to display on a page. > inc files are also used in JaveScript as well. Always place 'include-files' outside the documentroot of the webserver, since they're not supposed to be invoked directly by a user altering his URL. In case you can't place files for inclusing outside the docroot, in most situations it's better to use '.php' or '.inc.php' and make sure there's nothing harmfull happening when you try to view them or make really sure make sure the webserver doesn't show .inc files... It's a common mistake to put passwords etc. in a funtion e.g. for database access and when that's an .inc file and it doesn't get parsed through php but the source is sent to the user plain text... u c Hans -- "He who asks a question is a fool for five minutes; he who does not ask a question remains a fool forever" |
|
|||
|
.oO(vishal)
>i have seen some scripts which includes file like > >include('time.inc') > >so can anyone tell me what this file contain. HTML or PHP code to include into the current script. >and what is extension >meaning. 'inc' means 'include', but you can use any name you like. PHP doesn't care about the extension of an included file. Use what makes sense. Micha |
|
|||
|
It's a common mistake to put passwords etc. in a funtion e.g. for
database access and when that's an .inc file and it doesn't get parsed through php but the source is sent to the user plain text... u c this is very true, I'm sorry I fogot to mention that before. |
|
|||
|
behindspace wrote:
> It's a common mistake to put passwords etc. in a funtion e.g. for > database access and when that's an .inc file and it doesn't get parsed > through php but the source is sent to the user plain text... u c > > this is very true, I'm sorry I fogot to mention that before. > Too true. My local council does excactly that on their website. I've emailed the cretins and told them that their database login information is visible to anyone who uses any browsers "view source" option. They claim it isn't a security issue 'cos that database user ONLY has insert,update and delete permissions on the database. What can you do - if you pay peanuts then you employ monkeys ! |