PDA

Click to See Complete Forum and Search --> : include .php or .inc?


ober0330
May 17th, 2004, 02:29 PM
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?

Electroman
May 17th, 2004, 02:58 PM
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.

techgnome
May 17th, 2004, 03:10 PM
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

Electroman
May 17th, 2004, 03:47 PM
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? :confused:.

techgnome
May 17th, 2004, 04:18 PM
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

The Hobo
May 18th, 2004, 02:52 PM
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.