Jump to content

Page extensions....


gabe8496

Recommended Posts

I've been looking over some code and notice many use the following format (when doing and include)

 

pagename.inc.php

 

What effect does .inc have on a page that is included versus including a page without it? What am I missing? I did some search on web page extensions via google and couldn't find anything describing this.

 

Any info would be greatly appreciated.

 

Thanks,

 

Gabe

Link to comment
Share on other sites

Indeed. The only reason why people end with the extension .inc.php is to show that the file is one that will be included by others. Some people simply end with the extension .inc. However this is bad practice and a security issue, because it may lead people to be able to see the php code in plain text.

 

As for resticting access, it may not be necessary. As long as the final extension is .php, then the page will be parsed by the php processor, so no-one would be able to see your code. If access is still an issue, then as has been suggested, you can restrict with permissions or .htaccess. Another alternative is to place the files outside of the web root folder.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.