Whats an inc file?

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
Sly
Forum Newbie
Posts: 14
Joined: Wed Apr 02, 2003 8:29 am
Contact:

Whats an inc file?

Post by Sly »

Can someone explain to me whats an .inc file?
and what does it do between php and asp
whats the relation of them
can someone plz explained it to me like i am 3 years old?
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

it's just a file with another extension and a bad idea if it stands for include and contains php-code. For php it does not matter which extension a included file has but for the webserver it might and only the least are configured to let php handle *.inc or ignore that request. If this file is within your webdirectory someone might request it and will (probably) receive the source-code, very bad if it is secretAndValidFromWorldDbPass.inc ;)
use secretAndValidFromWorldDbPass.inc.php instead if you must.
User avatar
m3mn0n
PHP Evangelist
Posts: 3548
Joined: Tue Aug 13, 2002 3:35 pm
Location: Calgary, Canada

Post by m3mn0n »

PHP is configured so thoses are handled like regular text files instead of php code. It's very simple to set them to be handled like php in your web server config area. In apache this is how:

open /conf/httpd.conf

before:

Code: Select all

#
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
after:

Code: Select all

#
    # AddType allows you to tweak mime.types without actually editing it, or to
    # make certain files to be certain types.
    #
    AddType application/x-tar .tgz
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .inc
Post Reply