Jump to content

Recommended Posts

Is there a difference between naming a file that is to be included in a script with a .php or .inc extension?

For intance, if I want to include a script with my database connection info, does it matter if I use

include ("db.php"); or include ("db.inc"); ? is one more secure than the other? Thanks for the info!

 

Link to comment
https://forums.phpfreaks.com/topic/54510-general-question/
Share on other sites

If you connecting to the database using PHP, then I would assume it would require the .php extension. I'm not 100% sure though.

I'm sure that you could include an .inc file inside a .php file. I know you can include other filetypes, such as .txt, so I see no reason why you shouldn't be able to include .inc.

 

I don't know about .inc files though, so I can't comment on security issues..

Link to comment
https://forums.phpfreaks.com/topic/54510-general-question/#findComment-269616
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.