471,319 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

what is .inc file in php

hello

vishal here.

i have seen some scripts which includes file like
include('time.inc')

so can anyone tell me what this file contain. and what is extension
meaning. pls provide me also some link to this help if possible

thxs in advance.

Jul 17 '05 #1
5 8184
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.

Jul 17 '05 #2
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"
Jul 17 '05 #3
.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
Jul 17 '05 #4
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.

Jul 17 '05 #5
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 !
Jul 17 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by Karen Grube | last post: by
14 posts views Thread by Frances Del Rio | last post: by
2 posts views Thread by jun_qu | last post: by
1 post views Thread by Brian Simmons | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.