what is .inc file in php

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 ...


Go Back   Usenet Forums > PHP Programming Forums > PHP Language

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 03-03-2005
vishal
 
Posts: n/a
Default 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.

Reply With Quote
  #2 (permalink)  
Old 03-03-2005
behindspace
 
Posts: n/a
Default Re: what is .inc file in php

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.

Reply With Quote
  #3 (permalink)  
Old 03-03-2005
Hans van Kranenburg
 
Posts: n/a
Default Re: what is .inc file in php

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"
Reply With Quote
  #4 (permalink)  
Old 03-03-2005
Michael Fesser
 
Posts: n/a
Default Re: what is .inc file in php

.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
Reply With Quote
  #5 (permalink)  
Old 03-03-2005
behindspace
 
Posts: n/a
Default Re: what is .inc file in php

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.

Reply With Quote
  #6 (permalink)  
Old 03-03-2005
NSpam
 
Posts: n/a
Default Re: what is .inc file in php

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 !
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 10:59 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0