Advantages or disadvantages of .inc files

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

    Advantages or disadvantages of .inc files


    What are the advantages or disadvantages of .inc files over the
    'include' statement. I can't seem to find that information at the PHP
    website.

    Also the same for form building inline, I guess you would call it, and
    HTML template objects. File types of .tpl and .ihtml?

    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
    _______________ _______________ _______________ _______________ ______________

    'If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)
  • frizzle

    #2
    Re: Advantages or disadvantages of .inc files


    IchBin wrote:
    What are the advantages or disadvantages of .inc files over the
    'include' statement. I can't seem to find that information at the PHP
    website.
    >
    Also the same for form building inline, I guess you would call it, and
    HTML template objects. File types of .tpl and .ihtml?
    >
    Thanks in Advance...
    IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
    _______________ _______________ _______________ _______________ ______________
    >
    'If there is one, Knowledge is the "Fountain of Youth"'
    -William E. Taylor, Regular Guy (1952-)
    To answer your first question:
    if *.inc files were called directly via the browser's url, most likely
    it's content would be displayed unparsed. So your entire code would be
    naked on the internet, including possible passwords etc.)

    Instead if you want to use '.inc', you could use file.inc.php, which
    would be parsed before outputted to the browser.

    Frizzle.

    Comment

    • Juliette

      #3
      Re: Advantages or disadvantages of .inc files

      frizzle wrote:
      IchBin wrote:
      >What are the advantages or disadvantages of .inc files over the
      >'include' statement. I can't seem to find that information at the PHP
      >website.
      >>
      >Also the same for form building inline, I guess you would call it, and
      >HTML template objects. File types of .tpl and .ihtml?
      >>
      >Thanks in Advance...
      >IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
      >______________ _______________ _______________ _______________ _______________
      >>
      >'If there is one, Knowledge is the "Fountain of Youth"'
      >-William E. Taylor, Regular Guy (1952-)
      >
      To answer your first question:
      if *.inc files were called directly via the browser's url, most likely
      it's content would be displayed unparsed. So your entire code would be
      naked on the internet, including possible passwords etc.)
      >
      Instead if you want to use '.inc', you could use file.inc.php, which
      would be parsed before outputted to the browser.
      >
      Frizzle.
      >

      Or include the following in your .htaccess file:

      <Files ~ "\.inc$">
      Order allow,deny
      Deny from all
      </Files>

      Comment

      • Tony Marston

        #4
        Re: Advantages or disadvantages of .inc files

        The only "advantage" for using different extensions is that each extension
        helps identify the contents of each file. I use .php for scripts which can
        be executed, and .inc for scripts which must be included instead of
        executed. I presume Smarty use .tpl to identify its template files. It is
        just a matter of convention.

        --
        Tony Marston

        This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

        Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.




        "IchBin" <weconsul@ptd.n etwrote in message
        news:GwmdnfJ6qr XPliTZUSdV9g@pt d.net...
        >
        What are the advantages or disadvantages of .inc files over the 'include'
        statement. I can't seem to find that information at the PHP website.
        >
        Also the same for form building inline, I guess you would call it, and
        HTML template objects. File types of .tpl and .ihtml?
        >
        Thanks in Advance...
        IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
        _______________ _______________ _______________ _______________ ______________
        >
        'If there is one, Knowledge is the "Fountain of Youth"'
        -William E. Taylor, Regular Guy (1952-)

        Comment

        • Tony Marston

          #5
          Re: Advantages or disadvantages of .inc files


          "Juliette" <jrf_no_spam@jo keaday.netwrote in message
          news:44b9b6da$0 $73418$dbd4f001 @news.wanadoo.n l...
          frizzle wrote:
          >IchBin wrote:
          >>What are the advantages or disadvantages of .inc files over the
          >>'include' statement. I can't seem to find that information at the PHP
          >>website.
          >>>
          >>Also the same for form building inline, I guess you would call it, and
          >>HTML template objects. File types of .tpl and .ihtml?
          >>>
          >>Thanks in Advance...
          >>IchBin, Pocono Lake, Pa, USA http://weconsultants.phpnet.us
          >>_____________ _______________ _______________ _______________ _______________ _
          >>>
          >>'If there is one, Knowledge is the "Fountain of Youth"'
          >>-William E. Taylor, Regular Guy (1952-)
          >>
          >To answer your first question:
          >if *.inc files were called directly via the browser's url, most likely
          >it's content would be displayed unparsed. So your entire code would be
          >naked on the internet, including possible passwords etc.)
          >>
          >Instead if you want to use '.inc', you could use file.inc.php, which
          >would be parsed before outputted to the browser.
          >>
          >Frizzle.
          >>
          >
          >
          Or include the following in your .htaccess file:
          >
          <Files ~ "\.inc$">
          Order allow,deny
          Deny from all
          </Files>
          You can also put .inc files in a directory which is outside the web root, or
          in a password-protected directory so that its contents cannot be accessed
          through the web server.

          --
          Tony Marston

          This is Tony Marston's web site, containing personal information plus pages devoted to the Uniface 4GL development language, XML and XSL, PHP and MySQL, and a bit of COBOL

          Build apps faster with Rapid Application Development using open-source RAD tools, modern RAD frameworks, and rapid application design methods.




          Comment

          Working...