Results 1 to 6 of 6

Thread: include .php or .inc?

  1. #1

    Thread Starter
    Frenzied Member ober0330's Avatar
    Join Date
    Dec 2001
    Location
    OH, USA
    Posts
    1,945

    include .php or .inc?

    I've been doing some reading and I'm finding that when people use a repetitive file that is included in a lot of different pages, they make that file a "whatever.inc" file. Are there any advantages? I've just been including php files. I know they all get included the same way, so is it just a distinction thing?
    format your code!! - [vbcode] [/vbcode]

    ANSWERS CAN BE FOUND HERE!!

    my personal company

  2. #2
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    I have seen this too but mainly filename.inc.php
    I think its just so they know the file is never meant to be opened directly only ever included.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  3. #3
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    One advantage (or .php over .inc) is that if some one tries to go straight to the file in their browser, it'll run. IF you use jsut .inc, it'll return as a text file and may be able to read it.

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  4. #4
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349
    While we're on the topic what are .php3 files? I know that phps files show the source code with coloring but I was wondering if the php3 files are along these lines or are they treat like php files but informing you they were made for V3 or something? .
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

  5. #5
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    typically ph3 files were from the days of PHP 3. Because there were some changed to the language w/ 4, the 3 was used to signify that i used v3.x, allowing php4+ and php3 to run side by side (at least this is what I've been told.)

    TG
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    Originally posted by techgnome
    One advantage (or .php over .inc) is that if some one tries to go straight to the file in their browser, it'll run. IF you use jsut .inc, it'll return as a text file and may be able to read it.

    TG
    I'd use .php instead of .inc for the reasons techgnome stated above.

    In an early release of my vbsNews program, I used .inc for included files, then someone sent me an email saying "You know that people can view the database passwords when they browse to the config.inc page, right?"

    Needless to say, I switched to using .php for the included files.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width