PDA

View Full Version : Most efficient include extension?


Kayn
Fri 12th Jan '01, 1:38pm
Hey php hax0rs,

My question is this:

What type of filse extension would be fastest for includes? I am using straight text files right now, which is along the lines of:
<? include ("blargy.txt"); ?>

Now, I hear that maybe including other php files would be faster, or maybe creating .inc files - which I'm not sure php interprets and reads. I'm a dummy.

I'm a begenning to moderate php code guy (leaning closer towards the beginning), and I'm a BIG fan of optimization and fast loading times. :)

Thanks!

Freddie Bingham
Fri 12th Jan '01, 2:46pm
I don't believe it matters what extension you use as PHP is only opening a filehandle to the file and any extension is the same in that regard.

If you put .php as your extension then others can not open your include file from a web browser and view the source if you have your include file set a variable and then use that variable in the calling file. That is one benefit from using .php as your extension.

[Edited by freddie on 01-13-2001 at 01:09 AM]

JohnM
Fri 12th Jan '01, 3:59pm
It all works exactly the same, but using .php (or whatever your php extension is...) makes sure people don't see your source code, as freddie said.

Genotoxin
Sat 13th Jan '01, 12:58am
Yup, they're all the same, except .php or some other extension keeps your source from being seen. Good if you want to keep your site less open to newbie ha><0rs.

Toliman
Sat 20th Jan '01, 4:03pm
for added security I'd recommend keeping that includes outside of the document root, or in a subdirectory with a "deny from all" configure from apache..

JohnM
Sat 20th Jan '01, 7:01pm
it really doesn't matter if you use the correct extension.