what is .inc file in php

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • vishal

    what is .inc file in php

    hello

    vishal here.

    i have seen some scripts which includes file like


    include('time.i nc')

    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.

  • behindspace

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

    Comment

    • Hans van Kranenburg

      #3
      Re: what is .inc file in php

      behindspace wrote:[color=blue]
      > 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.[/color]

      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"

      Comment

      • Michael Fesser

        #4
        Re: what is .inc file in php

        .oO(vishal)
        [color=blue]
        >i have seen some scripts which includes file like
        >
        >include('time. inc')
        >
        >so can anyone tell me what this file contain.[/color]

        HTML or PHP code to include into the current script.
        [color=blue]
        >and what is extension
        >meaning.[/color]

        '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

        Comment

        • behindspace

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

          Comment

          • NSpam

            #6
            Re: what is .inc file in php

            behindspace wrote:[color=blue]
            > 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.
            >[/color]
            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 !

            Comment

            Working...